<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>Native File System</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://www.w3.org/StyleSheets/TR/2016/cg-draft" rel="stylesheet">
  <link href="https://wicg.github.io/native-file-system/" rel="canonical">
<style>
.domintro dt {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;

    padding-top: 0.5em;
    padding-bottom: 1em;
}
.domintro dt a {
    color: inherit; border-bottom-style: none;
}
.domintro dt code {
    font-size: inherit;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"></p>
   <h1 class="p-name no-ref" id="title">Native File System</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://wicg.github.io/native-file-system/">https://wicg.github.io/native-file-system/</a>
     <dt class="editor">Editor:
     <dd class="editor p-author h-card vcard" data-editor-id="72440"><a class="p-name fn u-email email" href="mailto:mek@chromium.org">Marijn Kruisselbrink</a> (<span class="p-org org">Google</span>)
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 the Contributors to the Native File System Specification, published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a> under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a>.
A human-readable <a href="http://www.w3.org/community/about/agreements/cla-deed/">summary</a> is available. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This document defines a web platform API that lets websites gain write access to the

  native file system. It builds on <a data-link-type="biblio" href="#biblio-file-api">[FILE-API]</a>, but adds lots of new functionality on top.</p>
  </div>
  <div data-fill-with="at-risk"></div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This specification was published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a>.
  It is not a W3C Standard nor is it on the W3C Standards Track.

  Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a> there is a limited opt-out and other conditions apply.

  Learn more about <a href="http://www.w3.org/community/">W3C Community and Business Groups</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a>
    <li>
     <a href="#files-and-directories"><span class="secno">2</span> <span class="content">Files and Directories</span></a>
     <ol class="toc">
      <li><a href="#concepts"><span class="secno">2.1</span> <span class="content">Concepts</span></a>
      <li>
       <a href="#api-filesystemhandle"><span class="secno">2.2</span> <span class="content">The <code class="idl"><span>FileSystemHandle</span></code> interface</span></a>
       <ol class="toc">
        <li><a href="#api-filesystemhandle-querypermission"><span class="secno">2.2.1</span> <span class="content">The <code class="idl"><span>queryPermission()</span></code> method</span></a>
        <li><a href="#api-filesystemhandle-requestpermission"><span class="secno">2.2.2</span> <span class="content">The <code class="idl"><span>requestPermission()</span></code> method</span></a>
       </ol>
      <li>
       <a href="#api-filesystemfilehandle"><span class="secno">2.3</span> <span class="content">The <code class="idl"><span>FileSystemFileHandle</span></code> interface</span></a>
       <ol class="toc">
        <li><a href="#api-filesystemfilehandle-getfile"><span class="secno">2.3.1</span> <span class="content">The <code class="idl"><span>getFile()</span></code> method</span></a>
        <li><a href="#api-filesystemfilehandle-createwriter"><span class="secno">2.3.2</span> <span class="content">The <code class="idl"><span>createWriter()</span></code> method</span></a>
       </ol>
      <li>
       <a href="#api-filesystemdirectoryhandle"><span class="secno">2.4</span> <span class="content">The <code class="idl"><span>FileSystemDirectoryHandle</span></code> interface</span></a>
       <ol class="toc">
        <li><a href="#api-filesystemdirectoryhandle-getfile"><span class="secno">2.4.1</span> <span class="content">The <code class="idl"><span>getFile()</span></code> method</span></a>
        <li><a href="#api-filesystemdirectoryhandle-getdirectory"><span class="secno">2.4.2</span> <span class="content">The <code class="idl"><span>getDirectory()</span></code> method</span></a>
        <li><a href="#api-filesystemdirectoryhandle-getentries"><span class="secno">2.4.3</span> <span class="content">The <code class="idl"><span>getEntries()</span></code> method</span></a>
        <li><a href="#api-filesystemdirectoryhandle-removeentry"><span class="secno">2.4.4</span> <span class="content">The <code class="idl"><span>removeEntry()</span></code> method</span></a>
       </ol>
      <li>
       <a href="#api-filesystemwriter"><span class="secno">2.5</span> <span class="content">The <code class="idl"><span>FileSystemWriter</span></code> interface</span></a>
       <ol class="toc">
        <li><a href="#api-filesystemwriter-write"><span class="secno">2.5.1</span> <span class="content">The <code class="idl"><span>write()</span></code> method</span></a>
        <li><a href="#api-filesystemwriter-truncate"><span class="secno">2.5.2</span> <span class="content">The <code class="idl"><span>truncate()</span></code> method</span></a>
        <li><a href="#api-filesystemwriter-close"><span class="secno">2.5.3</span> <span class="content">The <code class="idl"><span>close()</span></code> method</span></a>
       </ol>
     </ol>
    <li>
     <a href="#native-filesystem"><span class="secno">3</span> <span class="content">Accessing native filesystem</span></a>
     <ol class="toc">
      <li><a href="#api-choosefilesystementries"><span class="secno">3.1</span> <span class="content">The <code class="idl"><span>chooseFileSystemEntries()</span></code> method</span></a>
     </ol>
    <li>
     <a href="#special-filesystems"><span class="secno">4</span> <span class="content">Accessing special filesystems</span></a>
     <ol class="toc">
      <li><a href="#api-getsystemdirectory"><span class="secno">4.1</span> <span class="content">The <code class="idl"><span>getSystemDirectory()</span></code> method</span></a>
     </ol>
    <li>
     <a href="#privacy-considerations"><span class="secno">5</span> <span class="content">Privacy Considerations</span></a>
     <ol class="toc">
      <li><a href="#privacy-wide-access"><span class="secno">5.1</span> <span class="content">Users giving access to more, or more sensitive files than they intended.</span></a>
      <li><a href="#privacy-tracking"><span class="secno">5.2</span> <span class="content">Websites trying to use this API for tracking.</span></a>
      <li><a href="#privacy-third-party"><span class="secno">5.3</span> <span class="content">First-party vs third-party contexts.</span></a>
     </ol>
    <li>
     <a href="#security-considerations"><span class="secno">6</span> <span class="content">Security Considerations</span></a>
     <ol class="toc">
      <li><a href="#security-malware"><span class="secno">6.1</span> <span class="content">Malware</span></a>
      <li><a href="#security-ransomware"><span class="secno">6.2</span> <span class="content">Ransomware attacks</span></a>
     </ol>
    <li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2>
   <p><em>This section is non-normative.</em></p>
   <p>TODO</p>
   <p>This provides similar functionality as earlier drafts of the <a data-link-type="biblio" href="#biblio-file-system-api">[file-system-api]</a> as well as the <a data-link-type="biblio" href="#biblio-entries-api">[entries-api]</a>, but with a more modern API.</p>
   <h2 class="heading settled" data-level="2" id="files-and-directories"><span class="secno">2. </span><span class="content">Files and Directories</span><a class="self-link" href="#files-and-directories"></a></h2>
   <h3 class="heading settled" data-level="2.1" id="concepts"><span class="secno">2.1. </span><span class="content">Concepts</span><a class="self-link" href="#concepts"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="entry">entry</dfn> is either a <a data-link-type="dfn" href="#file" id="ref-for-file">file entry</a> or a <a data-link-type="dfn" href="#directory" id="ref-for-directory">directory entry</a>.</p>
   <p>Each <a data-link-type="dfn" href="#entry" id="ref-for-entry">entry</a> has an associated <dfn class="dfn-paneled" data-dfn-for="entry" data-dfn-type="dfn" data-noexport id="entry-name">name</dfn>.</p>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="file|file entry" data-noexport id="file">file entry</dfn> additionally consists of <dfn data-dfn-for="file entry" data-dfn-type="dfn" data-lt="binary data" data-noexport id="file-entry-binary-data">binary
data<a class="self-link" href="#file-entry-binary-data"></a></dfn> and a <dfn data-dfn-for="file entry" data-dfn-type="dfn" data-noexport id="file-entry-modification-timestamp">modification timestamp<a class="self-link" href="#file-entry-modification-timestamp"></a></dfn>.</p>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="directory|directory entry" data-noexport id="directory">directory entry</dfn> additionally consists of a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set">set</a> of <dfn data-dfn-for="directory entry" data-dfn-type="dfn" data-noexport id="directory-entry-entries">entries<a class="self-link" href="#directory-entry-entries"></a></dfn>. Each member is either a <a data-link-type="dfn" href="#file" id="ref-for-file①">file</a> or a <a data-link-type="dfn" href="#directory" id="ref-for-directory①">directory</a>.</p>
   <p class="issue" id="issue-7a61bf3c"><a class="self-link" href="#issue-7a61bf3c"></a> TODO: Explain how entries map to files on disk (multiple entries can map to the same file or
directory on disk but doesn’t have to map to any file on disk).</p>
   <h3 class="heading settled" data-level="2.2" id="api-filesystemhandle"><span class="secno">2.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle">FileSystemHandle</a></code> interface</span><a class="self-link" href="#api-filesystemhandle"></a></h3>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-filesystemhandlepermissiondescriptor"><code><c- g>FileSystemHandlePermissionDescriptor</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="FileSystemHandlePermissionDescriptor" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-filesystemhandlepermissiondescriptor-writable"><code><c- g>writable</c-></code></dfn> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable" id="ref-for-serializable"><c- g>Serializable</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="filesystemhandle"><code><c- g>FileSystemHandle</c-></code></dfn> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-filesystemhandle-isfile" id="ref-for-dom-filesystemhandle-isfile"><c- g>isFile</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-filesystemhandle-isdirectory" id="ref-for-dom-filesystemhandle-isdirectory"><c- g>isDirectory</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#dom-filesystemhandle-name" id="ref-for-dom-filesystemhandle-name"><c- g>name</c-></a>;

  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#enumdef-permissionstate" id="ref-for-enumdef-permissionstate"><c- n>PermissionState</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemhandle-querypermission" id="ref-for-dom-filesystemhandle-querypermission"><c- g>queryPermission</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemhandlepermissiondescriptor" id="ref-for-dictdef-filesystemhandlepermissiondescriptor"><c- n>FileSystemHandlePermissionDescriptor</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemHandle/queryPermission(descriptor), FileSystemHandle/queryPermission()" data-dfn-type="argument" data-export id="dom-filesystemhandle-querypermission-descriptor-descriptor"><code><c- g>descriptor</c-></code><a class="self-link" href="#dom-filesystemhandle-querypermission-descriptor-descriptor"></a></dfn> = {});
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#enumdef-permissionstate" id="ref-for-enumdef-permissionstate①"><c- n>PermissionState</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission"><c- g>requestPermission</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemhandlepermissiondescriptor" id="ref-for-dictdef-filesystemhandlepermissiondescriptor①"><c- n>FileSystemHandlePermissionDescriptor</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemHandle/requestPermission(descriptor), FileSystemHandle/requestPermission()" data-dfn-type="argument" data-export id="dom-filesystemhandle-requestpermission-descriptor-descriptor"><code><c- g>descriptor</c-></code><a class="self-link" href="#dom-filesystemhandle-requestpermission-descriptor-descriptor"></a></dfn> = {});
};
</pre>
   <p>A <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle①">FileSystemHandle</a></code> object represents a <a data-link-type="dfn" href="#entry" id="ref-for-entry①">entry</a>. Each <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle②">FileSystemHandle</a></code> object is assocaited
with a <dfn class="dfn-paneled" data-dfn-for="FileSystemHandle" data-dfn-type="dfn" data-noexport id="filesystemhandle-entry">entry</dfn> (a <a data-link-type="dfn" href="#entry" id="ref-for-entry②">entry</a>). Multiple separate objects implementing
the <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle③">FileSystemHandle</a></code> interface can all be associated with the same <a data-link-type="dfn" href="#entry" id="ref-for-entry③">entry</a> simultaneously.</p>
   <div class="algorithm" data-algorithm="serialization steps">
     <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle④">FileSystemHandle</a></code> objects are <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects" id="ref-for-serializable-objects">serializable objects</a>. 
    <p><strong class="advisement"> In the Origin Trial as available in Chrome 78, these objects are not yet serializable.</strong></p>
    <p>Their <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#serialization-steps" id="ref-for-serialization-steps">serialization steps</a>, given <var>value</var>, <var>serialized</var> and <var>forStorage</var> are:</p>
    <ol>
     <li data-md>
      <p>Set <var>serialized</var>.[[Origin]] to <var>value</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin">origin</a>.</p>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="deserialization steps">
     Their <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#deserialization-steps" id="ref-for-deserialization-steps">deserialization steps</a>, given <var>serialized</var> and <var>value</var> are: 
    <ol>
     <li data-md>
      <p>If <var>serialized</var>.[[Origin]] is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin">same origin</a> with <var>value</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin①">origin</a>,
 then throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#datacloneerror" id="ref-for-datacloneerror">DataCloneError</a></code>.</p>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-isfile" id="ref-for-dom-filesystemhandle-isfile①">isFile</a></code>
     <dd data-md>
      <p>Returns true iff <var>handle</var> is a <code class="idl"><a data-link-type="idl" href="#filesystemfilehandle" id="ref-for-filesystemfilehandle">FileSystemFileHandle</a></code>.</p>
     <dt data-md><var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-isdirectory" id="ref-for-dom-filesystemhandle-isdirectory①">isDirectory</a></code>
     <dd data-md>
      <p>Returns true iff <var>handle</var> is a <code class="idl"><a data-link-type="idl" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle">FileSystemDirectoryHandle</a></code>.</p>
     <dt data-md><var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-name" id="ref-for-dom-filesystemhandle-name①">name</a></code>
     <dd data-md>
      <p>Returns the <a data-link-type="dfn" href="#entry-name" id="ref-for-entry-name">name</a> of the entry represented by <var>handle</var>.</p>
    </dl>
   </div>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemHandle" data-dfn-type="attribute" data-export id="dom-filesystemhandle-isfile"><code>isFile</code></dfn> attribute must return true if the associated <a data-link-type="dfn" href="#filesystemhandle-entry" id="ref-for-filesystemhandle-entry">entry</a> is a <a data-link-type="dfn" href="#file" id="ref-for-file②">file entry</a>, and false otherwise.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemHandle" data-dfn-type="attribute" data-export id="dom-filesystemhandle-isdirectory"><code>isDirectory</code></dfn> attribute must return true if the
associated <a data-link-type="dfn" href="#filesystemhandle-entry" id="ref-for-filesystemhandle-entry①">entry</a> is a <a data-link-type="dfn" href="#directory" id="ref-for-directory②">directory entry</a>, and false otherwise.</p>
   <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemHandle" data-dfn-type="attribute" data-export id="dom-filesystemhandle-name"><code>name</code></dfn> attribute must return the <a data-link-type="dfn" href="#entry-name" id="ref-for-entry-name①">name</a> of the
associated <a data-link-type="dfn" href="#filesystemhandle-entry" id="ref-for-filesystemhandle-entry②">entry</a>.</p>
   <h4 class="heading settled" data-level="2.2.1" id="api-filesystemhandle-querypermission"><span class="secno">2.2.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-querypermission" id="ref-for-dom-filesystemhandle-querypermission①">queryPermission()</a></code> method</span><a class="self-link" href="#api-filesystemhandle-querypermission"></a></h4>
   <p class="issue" id="issue-af0c279b"><a class="self-link" href="#issue-af0c279b"></a> the currently described API here assumes a model where it is not possible to have a
    write-only handle. I.e. it is not possible to have or request write access without also having
    read access. There definitely are use cases for write-only handles (i.e. directory downloads),
    so we might have to reconsider this.</p>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>status</var> = await <var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-querypermission" id="ref-for-dom-filesystemhandle-querypermission②">queryPermission</a></code>({ <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandlepermissiondescriptor-writable" id="ref-for-dom-filesystemhandlepermissiondescriptor-writable">writable</a></code> = false })
     <dt data-md><var>status</var> = await <var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-querypermission" id="ref-for-dom-filesystemhandle-querypermission③">queryPermission()</a></code>
     <dd data-md>
      <p>Queries the current state of the read permission of this handle. If this returns <code>"prompt"</code> the website will have to call <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission①">requestPermission()</a></code> before any
 operations on the handle can be done. If this returns <code>"denied"</code> any operations will reject.</p>
      <p>Usually handles returned by <code class="idl"><a data-link-type="idl" href="#dom-window-choosefilesystementries" id="ref-for-dom-window-choosefilesystementries">chooseFileSystemEntries</a></code> will initially return <code>"granted"</code> for
 their read permission state, however other than through the user revoking permission, a handle
 retrieved from IndexedDB is also likely to return <code>"prompt"</code>.</p>
     <dt data-md><var>status</var> = await <var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-querypermission" id="ref-for-dom-filesystemhandle-querypermission④">queryPermission</a></code>({ <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandlepermissiondescriptor-writable" id="ref-for-dom-filesystemhandlepermissiondescriptor-writable①">writable</a></code> = true })
     <dd data-md>
      <p>Queries the current state of the write permission of this handle. If this returns <code>"prompt"</code>,
 attempting to modify the file or directory this handle represents will require user activation
 and will result in a confirmation prompt being shown to the user. However if the state of the
 read permission of this handle is also <code>"prompt"</code> the website will need to call <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission②">requestPermission()</a></code>. There is no automatic prompting for read access when
 attempting to read from a file or directory.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="queryPermission(descriptor)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemHandle" data-dfn-type="method" data-export data-lt="queryPermission(descriptor)|queryPermission()" id="dom-filesystemhandle-querypermission"><code>queryPermission(<var>descriptor</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.2.2" id="api-filesystemhandle-requestpermission"><span class="secno">2.2.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission③">requestPermission()</a></code> method</span><a class="self-link" href="#api-filesystemhandle-requestpermission"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>status</var> = await <var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission④">requestPermission</a></code>({ <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandlepermissiondescriptor-writable" id="ref-for-dom-filesystemhandlepermissiondescriptor-writable②">writable</a></code> = false })
     <dt data-md><var>status</var> = await <var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission⑤">requestPermission()</a></code>
     <dd data-md>
      <p>If the state of the read permission of this handle is anything other than <code>"prompt"</code>, this
 will return that state directly. If it is <code>"prompt"</code> however, user activation is needed and
 this will show a confirmation prompt to the user. The new read permission state is then
 returned, depending on the user’s response to the prompt.</p>
     <dt data-md><var>status</var> = await <var>handle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission⑥">requestPermission</a></code>({ <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandlepermissiondescriptor-writable" id="ref-for-dom-filesystemhandlepermissiondescriptor-writable③">writable</a></code> = true })
     <dd data-md>
      <p>If the state of the write permission of this handle is anything other than <code>"prompt"</code>, this
 will return that state directly. If the status of the read permission of this handle is <code>"denied"</code> this will return that.</p>
      <p>Otherwise the state of the write permission is <code>"prompt"</code> and this will show a confirmation
 prompt to the user. The new write permission state is then returned, depending on what the user
 selected.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="requestPermission(descriptor)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemHandle" data-dfn-type="method" data-export data-lt="requestPermission(descriptor)|requestPermission()" id="dom-filesystemhandle-requestpermission"><code>requestPermission(<var>descriptor</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="2.3" id="api-filesystemfilehandle"><span class="secno">2.3. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#filesystemfilehandle" id="ref-for-filesystemfilehandle①">FileSystemFileHandle</a></code> interface</span><a class="self-link" href="#api-filesystemfilehandle"></a></h3>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-filesystemcreatewriteroptions"><code><c- g>FileSystemCreateWriterOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="FileSystemCreateWriterOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-filesystemcreatewriteroptions-keepexistingdata"><code><c- g>keepExistingData</c-></code></dfn> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable" id="ref-for-serializable①"><c- g>Serializable</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="filesystemfilehandle"><code><c- g>FileSystemFileHandle</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle⑤"><c- n>FileSystemHandle</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://w3c.github.io/FileAPI/#dfn-file" id="ref-for-dfn-file"><c- n>File</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemfilehandle-getfile" id="ref-for-dom-filesystemfilehandle-getfile"><c- g>getFile</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemwriter" id="ref-for-filesystemwriter"><c- n>FileSystemWriter</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemfilehandle-createwriter" id="ref-for-dom-filesystemfilehandle-createwriter"><c- g>createWriter</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemcreatewriteroptions" id="ref-for-dictdef-filesystemcreatewriteroptions"><c- n>FileSystemCreateWriterOptions</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemFileHandle/createWriter(options), FileSystemFileHandle/createWriter()" data-dfn-type="argument" data-export id="dom-filesystemfilehandle-createwriter-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-filesystemfilehandle-createwriter-options-options"></a></dfn> = {});
};
</pre>
   <p><code class="idl"><a data-link-type="idl" href="#filesystemfilehandle" id="ref-for-filesystemfilehandle②">FileSystemFileHandle</a></code> objects are <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects" id="ref-for-serializable-objects①">serializable objects</a>. Their <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#serialization-steps" id="ref-for-serialization-steps①">serialization steps</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#deserialization-steps" id="ref-for-deserialization-steps①">deserialization steps</a> are the same as those for <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle⑥">FileSystemHandle</a></code>.</p>
   <p><strong class="advisement"> In the Origin Trial as available in Chrome 78, these objects are not yet serializable.</strong></p>
   <h4 class="heading settled" data-level="2.3.1" id="api-filesystemfilehandle-getfile"><span class="secno">2.3.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemfilehandle-getfile" id="ref-for-dom-filesystemfilehandle-getfile①">getFile()</a></code> method</span><a class="self-link" href="#api-filesystemfilehandle-getfile"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>file</var> = await <var>fileHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemfilehandle-getfile" id="ref-for-dom-filesystemfilehandle-getfile②">getFile()</a></code>
     <dd data-md>
      <p>Returns a <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/FileAPI/#dfn-file" id="ref-for-dfn-file①">File</a></code> representing the state on disk of the entry represented by <var>handle</var>.
 If the file on disk changes or is removed after this method is called, the returned <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/FileAPI/#dfn-file" id="ref-for-dfn-file②">File</a></code> object will likely be no longer readable.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="getFile()">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemFileHandle" data-dfn-type="method" data-export id="dom-filesystemfilehandle-getfile"><code>getFile()</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.3.2" id="api-filesystemfilehandle-createwriter"><span class="secno">2.3.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemfilehandle-createwriter" id="ref-for-dom-filesystemfilehandle-createwriter①">createWriter()</a></code> method</span><a class="self-link" href="#api-filesystemfilehandle-createwriter"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>writer</var> = await <var>fileHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemfilehandle-createwriter" id="ref-for-dom-filesystemfilehandle-createwriter②">createWriter()</a></code>
     <dt data-md><var>writer</var> = await <var>fileHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemfilehandle-createwriter" id="ref-for-dom-filesystemfilehandle-createwriter③">createWriter</a></code>({ <code class="idl"><a data-link-type="idl" href="#dom-filesystemcreatewriteroptions-keepexistingdata" id="ref-for-dom-filesystemcreatewriteroptions-keepexistingdata">keepExistingData</a></code>: true/false })
     <dd data-md>
      <p>Returns a <code class="idl"><a data-link-type="idl" href="#filesystemwriter" id="ref-for-filesystemwriter①">FileSystemWriter</a></code> that can be used to write to the file. Any changes made through <var>writer</var> won’t be reflected in the file represented by <var>fileHandle</var> until its <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close">close()</a></code> method is called.
 User agents try to ensure that no partial writes happen, i.e. the file represented by <var>fileHandle</var> will either contains its old contents or it will contain whatever data was written
 through <var>writer</var> up until <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close①">close()</a></code> was called.</p>
      <p>This is typically implemented by writing data to a temporary file, and only replacing the file
 represented by <var>fileHandle</var> with the temporary file when the writer is closed.</p>
      <p>If <code class="idl"><a data-link-type="idl" href="#dom-filesystemcreatewriteroptions-keepexistingdata" id="ref-for-dom-filesystemcreatewriteroptions-keepexistingdata①">keepExistingData</a></code> is <code>false</code> or not specified,
 the temporary file starts out empty,
 otherwise the existing file is first copied to this temporary file.</p>
    </dl>
   </div>
   <p class="issue" id="issue-6e95a203"><a class="self-link" href="#issue-6e95a203"></a> There has been some discussion around and desire for a "inPlace" mode for createWriter (where
changes will be written to the actual underlying file as they are written to the writer, for example
to support in-place modification of large files or things like databases). This is not currently
implemented in Chrome. Implementing this is currently blocked on figuring out how to combine the
desire to run malware checks with the desire to let websites make fast in-place modifications to
existing large files.</p>
   <div class="algorithm" data-algorithm="createWriter(options)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemFileHandle" data-dfn-type="method" data-export data-lt="createWriter(options)|createWriter()" id="dom-filesystemfilehandle-createwriter"><code>createWriter(<var>options</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="2.4" id="api-filesystemdirectoryhandle"><span class="secno">2.4. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle①">FileSystemDirectoryHandle</a></code> interface</span><a class="self-link" href="#api-filesystemdirectoryhandle"></a></h3>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-filesystemgetfileoptions"><code><c- g>FileSystemGetFileOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean④"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="FileSystemGetFileOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-filesystemgetfileoptions-create"><code><c- g>create</c-></code></dfn> = <c- b>false</c->;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-filesystemgetdirectoryoptions"><code><c- g>FileSystemGetDirectoryOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑤"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="FileSystemGetDirectoryOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-filesystemgetdirectoryoptions-create"><code><c- g>create</c-></code></dfn> = <c- b>false</c->;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-filesystemremoveoptions"><code><c- g>FileSystemRemoveOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑥"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="FileSystemRemoveOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-filesystemremoveoptions-recursive"><code><c- g>recursive</c-></code></dfn> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable" id="ref-for-serializable②"><c- g>Serializable</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="filesystemdirectoryhandle"><code><c- g>FileSystemDirectoryHandle</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle⑦"><c- n>FileSystemHandle</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemfilehandle" id="ref-for-filesystemfilehandle③"><c- n>FileSystemFileHandle</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getfile" id="ref-for-dom-filesystemdirectoryhandle-getfile"><c- g>getFile</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/getFile(name, options), FileSystemDirectoryHandle/getFile(name)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-getfile-name-options-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-getfile-name-options-name"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemgetfileoptions" id="ref-for-dictdef-filesystemgetfileoptions"><c- n>FileSystemGetFileOptions</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/getFile(name, options), FileSystemDirectoryHandle/getFile(name)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-getfile-name-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-getfile-name-options-options"></a></dfn> = {});
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle②"><c- n>FileSystemDirectoryHandle</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getdirectory" id="ref-for-dom-filesystemdirectoryhandle-getdirectory"><c- g>getDirectory</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString②"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/getDirectory(name, options), FileSystemDirectoryHandle/getDirectory(name)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-getdirectory-name-options-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-getdirectory-name-options-name"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemgetdirectoryoptions" id="ref-for-dictdef-filesystemgetdirectoryoptions"><c- n>FileSystemGetDirectoryOptions</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/getDirectory(name, options), FileSystemDirectoryHandle/getDirectory(name)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-getdirectory-name-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-getdirectory-name-options-options"></a></dfn> = {});

  // This really returns an async iterable, but that is not yet expressable in WebIDL.
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object"><c- b>object</c-></a> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getentries" id="ref-for-dom-filesystemdirectoryhandle-getentries"><c- g>getEntries</c-></a>();

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-removeentry" id="ref-for-dom-filesystemdirectoryhandle-removeentry"><c- g>removeEntry</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString③"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/removeEntry(name, options), FileSystemDirectoryHandle/removeEntry(name)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-removeentry-name-options-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-removeentry-name-options-name"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemremoveoptions" id="ref-for-dictdef-filesystemremoveoptions"><c- n>FileSystemRemoveOptions</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/removeEntry(name, options), FileSystemDirectoryHandle/removeEntry(name)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-removeentry-name-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-removeentry-name-options-options"></a></dfn> = {});
};
</pre>
   <p><code class="idl"><a data-link-type="idl" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle③">FileSystemDirectoryHandle</a></code> objects are <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects" id="ref-for-serializable-objects②">serializable objects</a>. Their <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#serialization-steps" id="ref-for-serialization-steps②">serialization steps</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/structured-data.html#deserialization-steps" id="ref-for-deserialization-steps②">deserialization steps</a> are the same as those for <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle⑧">FileSystemHandle</a></code>.</p>
   <p><strong class="advisement"> In the Origin Trial as available in Chrome 78, these objects are not yet serializable.</strong></p>
   <p class="issue" id="issue-a4e7d3b2"><a class="self-link" href="#issue-a4e7d3b2"></a> Should we have separate getFile and getDirectory methods, or just a single getChild/getEntry
method?</p>
   <p class="issue" id="issue-6152e539"><a class="self-link" href="#issue-6152e539"></a> Having getFile methods in both FileSystemDirectoryHandle and FileSystemFileHandle, but with
very different behavior might be confusing? Perhaps rename at least one of them (but see also
previous issue).</p>
   <p class="issue" id="issue-bd7b13a2"><a class="self-link" href="#issue-bd7b13a2"></a> Should getEntries be its own method, or should FileSystemDirectoryHandle just be an async
iterable itself?</p>
   <p class="issue" id="issue-1da05031"><a class="self-link" href="#issue-1da05031"></a> We will probably want some method to make it possible to compare two handles, and/or determine
if one handle represents a descendant of another handle. Such a method will enable for example an IDE
to detect that the user tries to open a file (through the file picker), where that file actually is
part of the "project" the IDE has open, allowing the IDE to highlight the selected file in a directory
tree.</p>
   <h4 class="heading settled" data-level="2.4.1" id="api-filesystemdirectoryhandle-getfile"><span class="secno">2.4.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getfile" id="ref-for-dom-filesystemdirectoryhandle-getfile①">getFile()</a></code> method</span><a class="self-link" href="#api-filesystemdirectoryhandle-getfile"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>fileHandle</var> = await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getfile" id="ref-for-dom-filesystemdirectoryhandle-getfile②">getFile</a></code>(<var>name</var>)
     <dt data-md><var>fileHandle</var> = await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getfile" id="ref-for-dom-filesystemdirectoryhandle-getfile③">getFile</a></code>(<var>name</var>, { <code class="idl"><a data-link-type="idl" href="#dom-filesystemgetfileoptions-create" id="ref-for-dom-filesystemgetfileoptions-create">create</a></code>: false })
     <dd data-md>
      <p>Returns a handle for a file named <var>name</var> in the directory represented by <var>directoryHandle</var>. If
 no such file exists, this rejects.</p>
     <dt data-md><var>fileHandle</var> = await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getfile" id="ref-for-dom-filesystemdirectoryhandle-getfile④">getFile</a></code>(<var>name</var>, { <code class="idl"><a data-link-type="idl" href="#dom-filesystemgetfileoptions-create" id="ref-for-dom-filesystemgetfileoptions-create①">create</a></code>: true })
     <dd data-md>
      <p>Returns a handle for a file named <var>name</var> in the directory represented by <var>directoryHandle</var>. If
 no such file exists, this creates a new file. If no file with named <var>name</var> can be created this
 rejects. Creation can fail because there already is a directory with the same name, because the
 name uses characters that aren’t supported in file names on the underlying file system, or
 because the user agent for security reasons decided not to allow creation of the file.</p>
      <p>This operation requires write permission, even if the file being returned already exists. If
 this handle doesn’t already have write permission, this could result in a prompt being shown to
 the user. To get an existing file without needing write permission, call this method
 with <code>{ <code class="idl"><a data-link-type="idl" href="#dom-filesystemgetfileoptions-create" id="ref-for-dom-filesystemgetfileoptions-create②">create</a></code>: false }</code>.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="getFile(name, options)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemDirectoryHandle" data-dfn-type="method" data-export data-lt="getFile(name, options)|getFile(name)" id="dom-filesystemdirectoryhandle-getfile"><code>getFile(<var>name</var>, <var>options</var>)</code></dfn> method, when invoked,
must run these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.4.2" id="api-filesystemdirectoryhandle-getdirectory"><span class="secno">2.4.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getdirectory" id="ref-for-dom-filesystemdirectoryhandle-getdirectory①">getDirectory()</a></code> method</span><a class="self-link" href="#api-filesystemdirectoryhandle-getdirectory"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>subdirHandle</var> = await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getdirectory" id="ref-for-dom-filesystemdirectoryhandle-getdirectory②">getDirectory</a></code>(<var>name</var>)
     <dt data-md><var>subdirHandle</var> = await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getdirectory" id="ref-for-dom-filesystemdirectoryhandle-getdirectory③">getDirectory</a></code>(<var>name</var>, { <code class="idl"><a data-link-type="idl" href="#dom-filesystemgetdirectoryoptions-create" id="ref-for-dom-filesystemgetdirectoryoptions-create">create</a></code>: false })
     <dd data-md>
      <p>Returns a handle for a directory named <var>name</var> in the directory represented by <var>directoryHandle</var>. If no such directory exists, this rejects.</p>
     <dt data-md><var>subdirHandle</var> = await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getdirectory" id="ref-for-dom-filesystemdirectoryhandle-getdirectory④">getDirectory</a></code>(<var>name</var>, { <code class="idl"><a data-link-type="idl" href="#dom-filesystemgetdirectoryoptions-create" id="ref-for-dom-filesystemgetdirectoryoptions-create①">create</a></code>: true })
     <dd data-md>
      <p>Returns a handle for a directory named <var>name</var> in the directory represented by <var>directoryHandle</var>. If no such directory exists, this creates a new directory. If creating the
 directory failed, this rejects. Creation can fail because there already is a file with the same
 name, or because the name uses characters that aren’t supported in file names on the underlying
 file system.</p>
      <p>This operation requires write permission, even if the directory being returned already exists.
 If this handle doesn’t already have write permission, this could result in a prompt being shown
 to the user. To get an existing directory without needing write permission, call this method
 with <code>{ <code class="idl"><a data-link-type="idl" href="#dom-filesystemgetdirectoryoptions-create" id="ref-for-dom-filesystemgetdirectoryoptions-create②">create</a></code>: false }</code>.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="getDirectory(name, options)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemDirectoryHandle" data-dfn-type="method" data-export data-lt="getDirectory(name, options)|getDirectory(name)" id="dom-filesystemdirectoryhandle-getdirectory"><code>getDirectory(<var>name</var>, <var>options</var>)</code></dfn> method, when
invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.4.3" id="api-filesystemdirectoryhandle-getentries"><span class="secno">2.4.3. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getentries" id="ref-for-dom-filesystemdirectoryhandle-getentries①">getEntries()</a></code> method</span><a class="self-link" href="#api-filesystemdirectoryhandle-getentries"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md>for await (const <var>handle</var> of <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getentries" id="ref-for-dom-filesystemdirectoryhandle-getentries②">getEntries()</a></code>) {}
     <dd data-md>
      <p>Iterates over all entries whose parent is the entry represented by <var>directoryHandle</var>.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="getEntries()">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemDirectoryHandle" data-dfn-type="method" data-export id="dom-filesystemdirectoryhandle-getentries"><code>getEntries()</code></dfn> method, when invoked, must run
these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.4.4" id="api-filesystemdirectoryhandle-removeentry"><span class="secno">2.4.4. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-removeentry" id="ref-for-dom-filesystemdirectoryhandle-removeentry①">removeEntry()</a></code> method</span><a class="self-link" href="#api-filesystemdirectoryhandle-removeentry"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md>await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-removeentry" id="ref-for-dom-filesystemdirectoryhandle-removeentry②">removeEntry</a></code>(<var>name</var>)
     <dt data-md>await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-removeentry" id="ref-for-dom-filesystemdirectoryhandle-removeentry③">removeEntry</a></code>(<var>name</var>, { <code class="idl"><a data-link-type="idl" href="#dom-filesystemremoveoptions-recursive" id="ref-for-dom-filesystemremoveoptions-recursive">recursive</a></code>: false })
     <dd data-md>
      <p>If the directory represented by <var>directoryHandle</var> contains a file named <var>name</var>, or an empty
 directory named <var>name</var>, this will attempt to delete that file or directory.</p>
      <p>Attempting to delete a file or directory that does not exist is considered success,
 while attempting to delete a non-empty directory will result in a promise rejection.</p>
     <dt data-md>await <var>directoryHandle</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-removeentry" id="ref-for-dom-filesystemdirectoryhandle-removeentry④">removeEntry</a></code>(<var>name</var>, { <code class="idl"><a data-link-type="idl" href="#dom-filesystemremoveoptions-recursive" id="ref-for-dom-filesystemremoveoptions-recursive①">recursive</a></code>: true })
     <dd data-md>
      <p>Removes the entry named <var>name</var> in the directory represented by <var>directoryHandle</var>.
 If that entry is a directory, its contents will also be deleted recursively.
 recursively.</p>
      <p>Attempting to delete a file or directory that does not exist is considered success.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="removeEntry(name, options)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemDirectoryHandle" data-dfn-type="method" data-export data-lt="removeEntry(name, options)|removeEntry(name)" id="dom-filesystemdirectoryhandle-removeentry"><code>removeEntry(<var>name</var>, <var>options</var>)</code></dfn> method, when invoked, must run
these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="2.5" id="api-filesystemwriter"><span class="secno">2.5. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#filesystemwriter" id="ref-for-filesystemwriter②">FileSystemWriter</a></code> interface</span><a class="self-link" href="#api-filesystemwriter"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="filesystemwriter"><code><c- g>FileSystemWriter</c-></code></dfn> {
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemwriter-write" id="ref-for-dom-filesystemwriter-write"><c- g>write</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemWriter/write(position, data)" data-dfn-type="argument" data-export id="dom-filesystemwriter-write-position-data-position"><code><c- g>position</c-></code><a class="self-link" href="#dom-filesystemwriter-write-position-data-position"></a></dfn>, (<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource"><c- n>BufferSource</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://w3c.github.io/FileAPI/#dfn-Blob" id="ref-for-dfn-Blob"><c- n>Blob</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString④"><c- b>USVString</c-></a>) <dfn class="idl-code" data-dfn-for="FileSystemWriter/write(position, data)" data-dfn-type="argument" data-export id="dom-filesystemwriter-write-position-data-data"><code><c- g>data</c-></code><a class="self-link" href="#dom-filesystemwriter-write-position-data-data"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemwriter-truncate" id="ref-for-dom-filesystemwriter-truncate"><c- g>truncate</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemWriter/truncate(size)" data-dfn-type="argument" data-export id="dom-filesystemwriter-truncate-size-size"><code><c- g>size</c-></code><a class="self-link" href="#dom-filesystemwriter-truncate-size-size"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close②"><c- g>close</c-></a>();
};
</pre>
   <p class="issue" id="issue-b9e65915"><a class="self-link" href="#issue-b9e65915"></a> We want some kind of integration with writable streams. One possible option is to make
FileStreamWriter inherit from WritableStream, but other options should be considered as well. <a href="https://github.com/wicg/native-file-system/issues/19">&lt;https://github.com/wicg/native-file-system/issues/19></a></p>
   <h4 class="heading settled" data-level="2.5.1" id="api-filesystemwriter-write"><span class="secno">2.5.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-write" id="ref-for-dom-filesystemwriter-write①">write()</a></code> method</span><a class="self-link" href="#api-filesystemwriter-write"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md>await <var>writer</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-write" id="ref-for-dom-filesystemwriter-write②">write</a></code>(<var>position</var>, <var>data</var>)
     <dd data-md>
      <p>Writes the content of <var>data</var> into the file associated with <var>writer</var> at position <var>position</var>.
 If <var>position</var> is past the end of the file writing will fail and this method rejects.</p>
      <p>No changes are written to the actual file until on disk until <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close③">close()</a></code> is called. Changes are typically written to a temporary file instead.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="write(position, data)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemWriter" data-dfn-type="method" data-export id="dom-filesystemwriter-write"><code>write(<var>position</var>, <var>data</var>)</code></dfn> method, when invoked, must run
these steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.5.2" id="api-filesystemwriter-truncate"><span class="secno">2.5.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-truncate" id="ref-for-dom-filesystemwriter-truncate①">truncate()</a></code> method</span><a class="self-link" href="#api-filesystemwriter-truncate"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md>await <var>writer</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-truncate" id="ref-for-dom-filesystemwriter-truncate②">truncate</a></code>(<var>size</var>)
     <dd data-md>
      <p>Resizes the file associated with <var>writer</var> to be <var>size</var> bytes long. If <var>size</var> is larger than
 the current file size this pads the file with zero bytes, otherwise it truncates the file.</p>
      <p>No changes are written to the actual file until on disk until <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close④">close()</a></code> is called. Changes are typically written to a temporary file instead.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="truncate(size)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemWriter" data-dfn-type="method" data-export id="dom-filesystemwriter-truncate"><code>truncate(<var>size</var>)</code></dfn> method, when invoked, must run these
steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="2.5.3" id="api-filesystemwriter-close"><span class="secno">2.5.3. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close⑤">close()</a></code> method</span><a class="self-link" href="#api-filesystemwriter-close"></a></h4>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md>await <var>writer</var> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close⑥">close()</a></code>
     <dd data-md>
      <p>First flushes any data written so far to disk, and then closes the writer.
 No changes will be visible in the destination file until this method is called.
 Furthermore, if the file on disk changed between creating this <var>writer</var> and this invocation of <code class="idl"><a data-link-type="idl" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close⑦">close()</a></code>, this will reject and all future operations on the writer will
 fail.</p>
      <p>This operation can take some time to complete, as user agents might use this moment to run
 malware scanners or perform other security checks if the website isn’t sufficiently trusted.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="close()">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemWriter" data-dfn-type="method" data-export id="dom-filesystemwriter-close"><code>close()</code></dfn> method, when invoked, must run these
steps: 
    <ol>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="3" id="native-filesystem"><span class="secno">3. </span><span class="content">Accessing native filesystem</span><a class="self-link" href="#native-filesystem"></a></h2>
   <h3 class="heading settled" data-level="3.1" id="api-choosefilesystementries"><span class="secno">3.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-window-choosefilesystementries" id="ref-for-dom-window-choosefilesystementries①">chooseFileSystemEntries()</a></code> method</span><a class="self-link" href="#api-choosefilesystementries"></a></h3>
<pre class="idl highlight def"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-choosefilesystementriestype"><code><c- g>ChooseFileSystemEntriesType</c-></code></dfn> { <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesType" data-dfn-type="enum-value" data-export id="dom-choosefilesystementriestype-open-file"><code><c- s>"open-file"</c-></code></dfn>, <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesType" data-dfn-type="enum-value" data-export id="dom-choosefilesystementriestype-save-file"><code><c- s>"save-file"</c-></code></dfn>, <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesType" data-dfn-type="enum-value" data-export id="dom-choosefilesystementriestype-open-directory"><code><c- s>"open-directory"</c-></code></dfn> };

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-choosefilesystementriesoptionsaccepts"><code><c- g>ChooseFileSystemEntriesOptionsAccepts</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑤"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesOptionsAccepts" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-choosefilesystementriesoptionsaccepts-description"><code><c- g>description</c-></code></dfn>;
  <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑥"><c- b>USVString</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesOptionsAccepts" data-dfn-type="dict-member" data-export data-type="sequence<USVString> " id="dom-choosefilesystementriesoptionsaccepts-mimetypes"><code><c- g>mimeTypes</c-></code></dfn>;
  <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑦"><c- b>USVString</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesOptionsAccepts" data-dfn-type="dict-member" data-export data-type="sequence<USVString> " id="dom-choosefilesystementriesoptionsaccepts-extensions"><code><c- g>extensions</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-choosefilesystementriesoptions"><code><c- g>ChooseFileSystemEntriesOptions</c-></code></dfn> {
    <a class="n" data-link-type="idl-name" href="#enumdef-choosefilesystementriestype" id="ref-for-enumdef-choosefilesystementriestype"><c- n>ChooseFileSystemEntriesType</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;open-file&quot;" data-dfn-for="ChooseFileSystemEntriesOptions" data-dfn-type="dict-member" data-export data-type="ChooseFileSystemEntriesType " id="dom-choosefilesystementriesoptions-type"><code><c- g>type</c-></code></dfn> = "open-file";
    <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑦"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="ChooseFileSystemEntriesOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-choosefilesystementriesoptions-multiple"><code><c- g>multiple</c-></code></dfn> = <c- b>false</c->;
    <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-choosefilesystementriesoptionsaccepts" id="ref-for-dictdef-choosefilesystementriesoptionsaccepts"><c- n>ChooseFileSystemEntriesOptionsAccepts</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="ChooseFileSystemEntriesOptions" data-dfn-type="dict-member" data-export data-type="sequence<ChooseFileSystemEntriesOptionsAccepts> " id="dom-choosefilesystementriesoptions-accepts"><code><c- g>accepts</c-></code></dfn>;
    <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑧"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="ChooseFileSystemEntriesOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-choosefilesystementriesoptions-excludeacceptalloption"><code><c- g>excludeAcceptAllOption</c-></code></dfn> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window"><c- g>Window</c-></a> {
    <c- b>Promise</c->&lt;(<a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle⑨"><c- n>FileSystemHandle</c-></a> <c- b>or</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle①⓪"><c- n>FileSystemHandle</c-></a>>)>
        <a class="idl-code" data-link-type="method" href="#dom-window-choosefilesystementries" id="ref-for-dom-window-choosefilesystementries②"><c- g>chooseFileSystemEntries</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-choosefilesystementriesoptions" id="ref-for-dictdef-choosefilesystementriesoptions"><c- n>ChooseFileSystemEntriesOptions</c-></a> <dfn class="idl-code" data-dfn-for="Window/chooseFileSystemEntries(options), Window/chooseFileSystemEntries()" data-dfn-type="argument" data-export id="dom-window-choosefilesystementries-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-window-choosefilesystementries-options-options"></a></dfn> = {});
};
</pre>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>result</var> = await window . <code class="idl"><a data-link-type="idl" href="#dom-window-choosefilesystementries" id="ref-for-dom-window-choosefilesystementries③">chooseFileSystemEntries</a></code>(<var>options</var>)
     <dd data-md>
      <p>Shows a file picker dialog to the user and returns handles for the selected files or
 directories.</p>
      <p>The <var>options</var> argument sets options that influence the behavior of the shown file picker.</p>
      <p><var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-type" id="ref-for-dom-choosefilesystementriesoptions-type">type</a></code> specifies the type of the entry the website
 wants the user to pick.
 When set to <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriestype-open-file" id="ref-for-dom-choosefilesystementriestype-open-file">"open-file"</a></code> (the default), the user can select only
 existing files.
 When set to <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriestype-save-file" id="ref-for-dom-choosefilesystementriestype-save-file">"save-file"</a></code> the dialog will additionally let the
 user select files that don’t yet exist, and if the user selects a file that does exist already,
 its contents will be cleared before the handle is returned to the website.
 Finally when set to <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriestype-open-directory" id="ref-for-dom-choosefilesystementriestype-open-directory">"open-directory"</a></code>, the dialog will let the
 user select directories instead of files.</p>
      <p>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-multiple" id="ref-for-dom-choosefilesystementriesoptions-multiple">multiple</a></code> is false (or absent) the user can
 only select a single file, and the <var>result</var> will be a single <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle①①">FileSystemHandle</a></code>. If on the
 other hand <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-multiple" id="ref-for-dom-choosefilesystementriesoptions-multiple①">multiple</a></code> is true, the dialog can let
 the user select more than one file, and <var>result</var> will be an array of <code class="idl"><a data-link-type="idl" href="#filesystemhandle" id="ref-for-filesystemhandle①②">FileSystemHandle</a></code> instances (even if the user did select a single file, if <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-multiple" id="ref-for-dom-choosefilesystementriesoptions-multiple②">multiple</a></code> is true this will be returned as a single-element
 array).</p>
      <p>Finally <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-accepts" id="ref-for-dom-choosefilesystementriesoptions-accepts">accepts</a></code> and <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-excludeacceptalloption" id="ref-for-dom-choosefilesystementriesoptions-excludeacceptalloption">excludeAcceptAllOption</a></code> specify the types of files
 the dialog will let the user select. Each entry in <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-accepts" id="ref-for-dom-choosefilesystementriesoptions-accepts①">accepts</a></code> describes a single type of file,
 consisting of a <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptionsaccepts-description" id="ref-for-dom-choosefilesystementriesoptionsaccepts-description">description</a></code>, zero or more <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptionsaccepts-mimetypes" id="ref-for-dom-choosefilesystementriesoptionsaccepts-mimetypes">mimeTypes</a></code> and zero or more <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptionsaccepts-extensions" id="ref-for-dom-choosefilesystementriesoptionsaccepts-extensions">extensions</a></code>. Options with no valid <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptionsaccepts-mimetypes" id="ref-for-dom-choosefilesystementriesoptionsaccepts-mimetypes①">mimeTypes</a></code> and no <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptionsaccepts-extensions" id="ref-for-dom-choosefilesystementriesoptionsaccepts-extensions①">extensions</a></code> are invalid and are ignored. If no <code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptionsaccepts-description" id="ref-for-dom-choosefilesystementriesoptionsaccepts-description①">description</a></code> is provided one will be generated.</p>
      <p>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-excludeacceptalloption" id="ref-for-dom-choosefilesystementriesoptions-excludeacceptalloption①">excludeAcceptAllOption</a></code> is true, or if no valid
 entries exist in <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-choosefilesystementriesoptions-accepts" id="ref-for-dom-choosefilesystementriesoptions-accepts②">accepts</a></code>, a option matching all
 files will be included in the file types the dialog lets the user select.</p>
    </dl>
   </div>
   <div class="algorithm" data-algorithm="chooseFileSystemEntries(options)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export data-lt="chooseFileSystemEntries(options)|chooseFileSystemEntries()" id="dom-window-choosefilesystementries"><code>chooseFileSystemEntries(<var>options</var>)</code></dfn> method, when invoked, must run
these steps: 
    <ol>
     <li data-md>
      <p>Let <var>environment</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object">current settings object</a>.</p>
     <li data-md>
      <p>If <var>environment</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin②">origin</a> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque">opaque origin</a>,
 return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror">SecurityError</a></code>.</p>
     <li data-md>
      <p>Let <var>browsing context</var> be <var>environment</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context" id="ref-for-responsible-browsing-context">responsible browsing context</a>.</p>
     <li data-md>
      <p>Let <var>top-level context</var> be <var>browsing context</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context" id="ref-for-top-level-browsing-context">top-level browsing context</a>.</p>
     <li data-md>
      <p>If <var>environment</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin③">origin</a> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin①">same origin</a> with <var>browsing context</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context" id="ref-for-top-level-browsing-context①">top-level browsing context</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document">active document</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin">origin</a>,
 return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①">SecurityError</a></code>.</p>
      <p class="issue" id="issue-0fb1070c"><a class="self-link" href="#issue-0fb1070c"></a> There must be a better way to express this "no third-party iframes" constraint.</p>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="4" id="special-filesystems"><span class="secno">4. </span><span class="content">Accessing special filesystems</span><a class="self-link" href="#special-filesystems"></a></h2>
   <h3 class="heading settled" data-level="4.1" id="api-getsystemdirectory"><span class="secno">4.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getsystemdirectory" id="ref-for-dom-filesystemdirectoryhandle-getsystemdirectory">getSystemDirectory()</a></code> method</span><a class="self-link" href="#api-getsystemdirectory"></a></h3>
<pre class="idl highlight def"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-systemdirectorytype"><code><c- g>SystemDirectoryType</c-></code></dfn> {
  <dfn class="dfn-paneled idl-code" data-dfn-for="SystemDirectoryType" data-dfn-type="enum-value" data-export id="dom-systemdirectorytype-sandbox"><code><c- s>"sandbox"</c-></code></dfn>
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-getsystemdirectoryoptions"><code><c- g>GetSystemDirectoryOptions</c-></code></dfn> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-systemdirectorytype" id="ref-for-enumdef-systemdirectorytype"><c- n>SystemDirectoryType</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="GetSystemDirectoryOptions" data-dfn-type="dict-member" data-export data-type="SystemDirectoryType " id="dom-getsystemdirectoryoptions-type"><code><c- g>type</c-></code></dfn>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle④"><c- g>FileSystemDirectoryHandle</c-></a> {
  <c- b>static</c-> <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle⑤"><c- n>FileSystemDirectoryHandle</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getsystemdirectory" id="ref-for-dom-filesystemdirectoryhandle-getsystemdirectory①"><c- g>getSystemDirectory</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-getsystemdirectoryoptions" id="ref-for-dictdef-getsystemdirectoryoptions"><c- n>GetSystemDirectoryOptions</c-></a> <dfn class="idl-code" data-dfn-for="FileSystemDirectoryHandle/getSystemDirectory(options)" data-dfn-type="argument" data-export id="dom-filesystemdirectoryhandle-getsystemdirectory-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-filesystemdirectoryhandle-getsystemdirectory-options-options"></a></dfn>);
};
</pre>
   <div class="note domintro" role="note">
    <dl>
     <dt data-md><var>directoryHandle</var> = <code class="idl"><a data-link-type="idl" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle⑥">FileSystemDirectoryHandle</a></code> . <code class="idl"><a data-link-type="idl" href="#dom-filesystemdirectoryhandle-getsystemdirectory" id="ref-for-dom-filesystemdirectoryhandle-getsystemdirectory②">getSystemDirectory</a></code>({ <code class="idl"><a data-link-type="idl" href="#dom-getsystemdirectoryoptions-type" id="ref-for-dom-getsystemdirectoryoptions-type">type</a></code>: <code class="idl"><a data-link-type="idl" href="#dom-systemdirectorytype-sandbox" id="ref-for-dom-systemdirectorytype-sandbox">"sandbox"</a></code> })
     <dd data-md>
      <p>Returns the sandboxed filesystem.</p>
    </dl>
   </div>
   <p class="issue" id="issue-2a3d989a"><a class="self-link" href="#issue-2a3d989a"></a> getSystemDirectory might not be the best name. Also perhaps should be on Window rather
than on FileSystemDirectoryHandle. <a href="https://github.com/wicg/native-file-system/issues/27">&lt;https://github.com/wicg/native-file-system/issues/27></a></p>
   <div class="algorithm" data-algorithm="getSystemDirectory(options)">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="FileSystemDirectoryHandle" data-dfn-type="method" data-export id="dom-filesystemdirectoryhandle-getsystemdirectory"><code>getSystemDirectory(<var>options</var>)</code></dfn> method, when
invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>environment</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①">current settings object</a>.</p>
     <li data-md>
      <p>If <var>environment</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin④">origin</a> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque①">opaque origin</a>,
 return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror②">SecurityError</a></code>.</p>
     <li data-md>
      <p>TODO</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="5" id="privacy-considerations"><span class="secno">5. </span><span class="content">Privacy Considerations</span><a class="self-link" href="#privacy-considerations"></a></h2>
   <p><em>This section is non-normative.</em></p>
   <p>This API does not give websites any more read access to data than the existing <code>&lt;input type=file></code> and <code>&lt;input type=file webkitdirectory></code> APIs already do. Furthermore similarly to those APIs, all
access to files and directories is explicitly gated behind a file or directory picker.</p>
   <p>There are however several major privacy risks with this new API:</p>
   <h3 class="heading settled" data-level="5.1" id="privacy-wide-access"><span class="secno">5.1. </span><span class="content">Users giving access to more, or more sensitive files than they intended.</span><a class="self-link" href="#privacy-wide-access"></a></h3>
   <p>This isn’t a new risk with this API, but user agents should try to make sure that users are aware
of what exactly they’re giving websites access to. This is particularly important when giving
access to a directory, where it might not be immediately clear to a user just how many files
actually exist in that directory.</p>
   <p>A related risk is having a user give access to particularly sensitive data. This
could include some of a user agent’s configuration data, network cache or cookie store,
or operating system configuration data such as password files. To protect against this, user agents
are encouraged to restrict which directories a user is allowed to select in a directory picker,
and potentially even restrict which files the user is allowed to select. This will make it much
harder to accidentally give access to a directory that contains particularly sensitive data. Care
must be taken to strike the right balance between restricting what the API can access while still
having the API be useful. After all, this API intentionally lets the user use websites to interact
with some of their most private personal data.</p>
   <h3 class="heading settled" data-level="5.2" id="privacy-tracking"><span class="secno">5.2. </span><span class="content">Websites trying to use this API for tracking.</span><a class="self-link" href="#privacy-tracking"></a></h3>
   <p>This API could be used by websites to track the user across clearing browsing
data. This is because, in contrast with existing file access APIs, user agents are
able to grant persistent access to files or directories and can re-prompt. In
combination with the ability to write to files, websites will be able to persist an
identifier on the users' disk. Clearing browsing data will not affect those files
in any way, making these identifiers persist through those actions.</p>
   <p>This risk is somewhat mitigated by the fact that clearing browsing data will also clear IndexedDB,
so websites won’t have any handles to re-prompt for permission after browsing data was cleared.
Furthermore user agents are encouraged to make it clear what files and directories a website has
access to, and to automatically expire permission grants except for particularly well trusted
origins (for example persistent permissions could be limited to "installed" web applications).</p>
   <p>User agents also are encouraged to provide a way for users to revoke permissions granted.
Clearing browsing data is expected to revoke all permissions as well.</p>
   <h3 class="heading settled" data-level="5.3" id="privacy-third-party"><span class="secno">5.3. </span><span class="content">First-party vs third-party contexts.</span><a class="self-link" href="#privacy-third-party"></a></h3>
   <p>In third-party contexts (i.e. an iframe whose origin does not match that of the top-level frame)
websites can’t gain access to data they don’t already have access to. This includes both getting
access to new files or directories via the <code class="idl"><a data-link-type="idl" href="#dom-window-choosefilesystementries" id="ref-for-dom-window-choosefilesystementries④">chooseFileSystemEntries</a></code> API, as well as requesting
more permissions to existing handles via the <code class="idl"><a data-link-type="idl" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission⑦">requestPermission</a></code> API.</p>
   <p>Handles can also only be post-messaged to same-origin destinations. Attempts to send a handle to
a cross-origin destination will result in a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/indices.html#event-messageerror" id="ref-for-event-messageerror">messageerror</a></code> event.</p>
   <h2 class="heading settled" data-level="6" id="security-considerations"><span class="secno">6. </span><span class="content">Security Considerations</span><a class="self-link" href="#security-considerations"></a></h2>
   <p><em>This section is non-normative.</em></p>
   <p>This API gives websites the ability to modify existing files on disk, as well as write to new
files. This has a couple of important security considerations:</p>
   <h3 class="heading settled" data-level="6.1" id="security-malware"><span class="secno">6.1. </span><span class="content">Malware</span><a class="self-link" href="#security-malware"></a></h3>
   <p>This API could be used by websites to try to store and/or execute malware on the users system.
To mitigate this risk, this API does not provide any way to mark files as executable (on the other
hand files that are already executable likely remain that way, even after the files are modified
through this API). Furthermore user agents are encouraged to apply things like Mark-of-the-Web to
files created or modified by this API.</p>
   <p>Finally, user agents are encouraged to verify the contents of files modified by this API via malware
scans and safe browsing checks, unless some kind of external strong trust relation already exists.
This of course has effects on the performance characteristics of this API.</p>
   <p class="issue" id="issue-1f744509"><a class="self-link" href="#issue-1f744509"></a> "Atomic writes" attempts to make it explicit what this API can and can’t do, and how
performance can be effected by safe browsing checks. <a href="https://github.com/wicg/native-file-system/issues/51">&lt;https://github.com/wicg/native-file-system/issues/51></a></p>
   <h3 class="heading settled" data-level="6.2" id="security-ransomware"><span class="secno">6.2. </span><span class="content">Ransomware attacks</span><a class="self-link" href="#security-ransomware"></a></h3>
   <p>Another risk factor is that of ransomware attacks. The limitations described above regarding
blocking access to certain sensitive directories helps limit the damage such an attack can do.
Additionally user agents can grant write access to files at whatever granularity they deem
appropriate.</p>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <p> Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology.
            The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
            in the normative parts of this document
            are to be interpreted as described in RFC 2119.
            However, for readability,
            these words do not appear in all uppercase letters in this specification. </p>
   <p> All of the text of this specification is normative
            except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
   <p> Examples in this specification are introduced with the words “for example”
            or are set apart from the normative text with <code>class="example"</code>, like this: </p>
   <div class="example" id="example-example"><a class="self-link" href="#example-example"></a> This is an example of an informative example. </div>
   <p> Informative notes begin with the word “Note”
            and are set apart from the normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note"> Note, this is an informative note. </p>
  </div>
<script>
(function() {
  "use strict";
  var collapseSidebarText = '<span aria-hidden="true">←</span> '
                          + '<span>Collapse Sidebar</span>';
  var expandSidebarText   = '<span aria-hidden="true">→</span> '
                          + '<span>Pop Out Sidebar</span>';
  var tocJumpText         = '<span aria-hidden="true">↑</span> '
                          + '<span>Jump to Table of Contents</span>';

  var sidebarMedia = window.matchMedia('screen and (min-width: 78em)');
  var autoToggle   = function(e){ toggleSidebar(e.matches) };
  if(sidebarMedia.addListener) {
    sidebarMedia.addListener(autoToggle);
  }

  function toggleSidebar(on) {
    if (on == undefined) {
      on = !document.body.classList.contains('toc-sidebar');
    }

    /* Don’t scroll to compensate for the ToC if we’re above it already. */
    var headY = 0;
    var head = document.querySelector('.head');
    if (head) {
      // terrible approx of "top of ToC"
      headY += head.offsetTop + head.offsetHeight;
    }
    var skipScroll = window.scrollY < headY;

    var toggle = document.getElementById('toc-toggle');
    var tocNav = document.getElementById('toc');
    if (on) {
      var tocHeight = tocNav.offsetHeight;
      document.body.classList.add('toc-sidebar');
      document.body.classList.remove('toc-inline');
      toggle.innerHTML = collapseSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, 0 - tocHeight);
      }
      tocNav.focus();
      sidebarMedia.addListener(autoToggle); // auto-collapse when out of room
    }
    else {
      document.body.classList.add('toc-inline');
      document.body.classList.remove('toc-sidebar');
      toggle.innerHTML = expandSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, tocNav.offsetHeight);
      }
      if (toggle.matches(':hover')) {
        /* Unfocus button when not using keyboard navigation,
           because I don’t know where else to send the focus. */
        toggle.blur();
      }
    }
  }

  function createSidebarToggle() {
    /* Create the sidebar toggle in JS; it shouldn’t exist when JS is off. */
    var toggle = document.createElement('a');
      /* This should probably be a button, but appearance isn’t standards-track.*/
    toggle.id = 'toc-toggle';
    toggle.class = 'toc-toggle';
    toggle.href = '#toc';
    toggle.innerHTML = collapseSidebarText;

    sidebarMedia.addListener(autoToggle);
    var toggler = function(e) {
      e.preventDefault();
      sidebarMedia.removeListener(autoToggle); // persist explicit off states
      toggleSidebar();
      return false;
    }
    toggle.addEventListener('click', toggler, false);


    /* Get <nav id=toc-nav>, or make it if we don’t have one. */
    var tocNav = document.getElementById('toc-nav');
    if (!tocNav) {
      tocNav = document.createElement('p');
      tocNav.id = 'toc-nav';
      /* Prepend for better keyboard navigation */
      document.body.insertBefore(tocNav, document.body.firstChild);
    }
    /* While we’re at it, make sure we have a Jump to Toc link. */
    var tocJump = document.getElementById('toc-jump');
    if (!tocJump) {
      tocJump = document.createElement('a');
      tocJump.id = 'toc-jump';
      tocJump.href = '#toc';
      tocJump.innerHTML = tocJumpText;
      tocNav.appendChild(tocJump);
    }

    tocNav.appendChild(toggle);
  }

  var toc = document.getElementById('toc');
  if (toc) {
    createSidebarToggle();
    toggleSidebar(sidebarMedia.matches);

    /* If the sidebar has been manually opened and is currently overlaying the text
       (window too small for the MQ to add the margin to body),
       then auto-close the sidebar once you click on something in there. */
    toc.addEventListener('click', function(e) {
      if(e.target.tagName.toLowerCase() == "a" && document.body.classList.contains('toc-sidebar') && !sidebarMedia.matches) {
        toggleSidebar(false);
      }
    }, false);
  }
  else {
    console.warn("Can’t find Table of Contents. Please use <nav id='toc'> around the ToC.");
  }

  /* Wrap tables in case they overflow */
  var tables = document.querySelectorAll(':not(.overlarge) > table.data, :not(.overlarge) > table.index');
  var numTables = tables.length;
  for (var i = 0; i < numTables; i++) {
    var table = tables[i];
    var wrapper = document.createElement('div');
    wrapper.className = 'overlarge';
    table.parentNode.insertBefore(wrapper, table);
    wrapper.appendChild(table);
  }

})();
</script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#dom-choosefilesystementriesoptions-accepts">accepts</a><span>, in §3.1</span>
   <li><a href="#file-entry-binary-data">binary data</a><span>, in §2.1</span>
   <li><a href="#dom-window-choosefilesystementries">chooseFileSystemEntries()</a><span>, in §3.1</span>
   <li><a href="#dom-window-choosefilesystementries">chooseFileSystemEntries(options)</a><span>, in §3.1</span>
   <li><a href="#dictdef-choosefilesystementriesoptions">ChooseFileSystemEntriesOptions</a><span>, in §3.1</span>
   <li><a href="#dictdef-choosefilesystementriesoptionsaccepts">ChooseFileSystemEntriesOptionsAccepts</a><span>, in §3.1</span>
   <li><a href="#enumdef-choosefilesystementriestype">ChooseFileSystemEntriesType</a><span>, in §3.1</span>
   <li><a href="#dom-filesystemwriter-close">close()</a><span>, in §2.5.3</span>
   <li>
    create
    <ul>
     <li><a href="#dom-filesystemgetdirectoryoptions-create">dict-member for FileSystemGetDirectoryOptions</a><span>, in §2.4</span>
     <li><a href="#dom-filesystemgetfileoptions-create">dict-member for FileSystemGetFileOptions</a><span>, in §2.4</span>
    </ul>
   <li><a href="#dom-filesystemfilehandle-createwriter">createWriter()</a><span>, in §2.3.2</span>
   <li><a href="#dom-filesystemfilehandle-createwriter">createWriter(options)</a><span>, in §2.3.2</span>
   <li><a href="#dom-choosefilesystementriesoptionsaccepts-description">description</a><span>, in §3.1</span>
   <li><a href="#directory">directory</a><span>, in §2.1</span>
   <li><a href="#directory">directory entry</a><span>, in §2.1</span>
   <li><a href="#directory-entry-entries">entries</a><span>, in §2.1</span>
   <li>
    entry
    <ul>
     <li><a href="#entry">definition of</a><span>, in §2.1</span>
     <li><a href="#filesystemhandle-entry">dfn for FileSystemHandle</a><span>, in §2.2</span>
    </ul>
   <li><a href="#dom-choosefilesystementriesoptions-excludeacceptalloption">excludeAcceptAllOption</a><span>, in §3.1</span>
   <li><a href="#dom-choosefilesystementriesoptionsaccepts-extensions">extensions</a><span>, in §3.1</span>
   <li><a href="#file">file</a><span>, in §2.1</span>
   <li><a href="#file">file entry</a><span>, in §2.1</span>
   <li><a href="#dictdef-filesystemcreatewriteroptions">FileSystemCreateWriterOptions</a><span>, in §2.3</span>
   <li><a href="#filesystemdirectoryhandle">FileSystemDirectoryHandle</a><span>, in §2.4</span>
   <li><a href="#filesystemfilehandle">FileSystemFileHandle</a><span>, in §2.3</span>
   <li><a href="#dictdef-filesystemgetdirectoryoptions">FileSystemGetDirectoryOptions</a><span>, in §2.4</span>
   <li><a href="#dictdef-filesystemgetfileoptions">FileSystemGetFileOptions</a><span>, in §2.4</span>
   <li><a href="#filesystemhandle">FileSystemHandle</a><span>, in §2.2</span>
   <li><a href="#dictdef-filesystemhandlepermissiondescriptor">FileSystemHandlePermissionDescriptor</a><span>, in §2.2</span>
   <li><a href="#dictdef-filesystemremoveoptions">FileSystemRemoveOptions</a><span>, in §2.4</span>
   <li><a href="#filesystemwriter">FileSystemWriter</a><span>, in §2.5</span>
   <li><a href="#dom-filesystemdirectoryhandle-getdirectory">getDirectory(name)</a><span>, in §2.4.2</span>
   <li><a href="#dom-filesystemdirectoryhandle-getdirectory">getDirectory(name, options)</a><span>, in §2.4.2</span>
   <li><a href="#dom-filesystemdirectoryhandle-getentries">getEntries()</a><span>, in §2.4.3</span>
   <li><a href="#dom-filesystemfilehandle-getfile">getFile()</a><span>, in §2.3.1</span>
   <li><a href="#dom-filesystemdirectoryhandle-getfile">getFile(name)</a><span>, in §2.4.1</span>
   <li><a href="#dom-filesystemdirectoryhandle-getfile">getFile(name, options)</a><span>, in §2.4.1</span>
   <li><a href="#dom-filesystemdirectoryhandle-getsystemdirectory">getSystemDirectory(options)</a><span>, in §4.1</span>
   <li><a href="#dictdef-getsystemdirectoryoptions">GetSystemDirectoryOptions</a><span>, in §4.1</span>
   <li><a href="#dom-filesystemhandle-isdirectory">isDirectory</a><span>, in §2.2</span>
   <li><a href="#dom-filesystemhandle-isfile">isFile</a><span>, in §2.2</span>
   <li><a href="#dom-filesystemcreatewriteroptions-keepexistingdata">keepExistingData</a><span>, in §2.3</span>
   <li><a href="#dom-choosefilesystementriesoptionsaccepts-mimetypes">mimeTypes</a><span>, in §3.1</span>
   <li><a href="#file-entry-modification-timestamp">modification timestamp</a><span>, in §2.1</span>
   <li><a href="#dom-choosefilesystementriesoptions-multiple">multiple</a><span>, in §3.1</span>
   <li>
    name
    <ul>
     <li><a href="#dom-filesystemhandle-name">attribute for FileSystemHandle</a><span>, in §2.2</span>
     <li><a href="#entry-name">dfn for entry</a><span>, in §2.1</span>
    </ul>
   <li><a href="#dom-choosefilesystementriestype-open-directory">"open-directory"</a><span>, in §3.1</span>
   <li><a href="#dom-choosefilesystementriestype-open-file">"open-file"</a><span>, in §3.1</span>
   <li><a href="#dom-filesystemhandle-querypermission">queryPermission()</a><span>, in §2.2.1</span>
   <li><a href="#dom-filesystemhandle-querypermission">queryPermission(descriptor)</a><span>, in §2.2.1</span>
   <li><a href="#dom-filesystemremoveoptions-recursive">recursive</a><span>, in §2.4</span>
   <li><a href="#dom-filesystemdirectoryhandle-removeentry">removeEntry(name)</a><span>, in §2.4.4</span>
   <li><a href="#dom-filesystemdirectoryhandle-removeentry">removeEntry(name, options)</a><span>, in §2.4.4</span>
   <li><a href="#dom-filesystemhandle-requestpermission">requestPermission()</a><span>, in §2.2.2</span>
   <li><a href="#dom-filesystemhandle-requestpermission">requestPermission(descriptor)</a><span>, in §2.2.2</span>
   <li><a href="#dom-systemdirectorytype-sandbox">"sandbox"</a><span>, in §4.1</span>
   <li><a href="#dom-choosefilesystementriestype-save-file">"save-file"</a><span>, in §3.1</span>
   <li><a href="#enumdef-systemdirectorytype">SystemDirectoryType</a><span>, in §4.1</span>
   <li><a href="#dom-filesystemwriter-truncate">truncate(size)</a><span>, in §2.5.2</span>
   <li>
    type
    <ul>
     <li><a href="#dom-choosefilesystementriesoptions-type">dict-member for ChooseFileSystemEntriesOptions</a><span>, in §3.1</span>
     <li><a href="#dom-getsystemdirectoryoptions-type">dict-member for GetSystemDirectoryOptions</a><span>, in §4.1</span>
    </ul>
   <li><a href="#dom-filesystemhandlepermissiondescriptor-writable">writable</a><span>, in §2.2</span>
   <li><a href="#dom-filesystemwriter-write">write(position, data)</a><span>, in §2.5.1</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-dfn-Blob">
   <a href="https://w3c.github.io/FileAPI/#dfn-Blob">https://w3c.github.io/FileAPI/#dfn-Blob</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-Blob">2.5. The FileSystemWriter interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-file">
   <a href="https://w3c.github.io/FileAPI/#dfn-file">https://w3c.github.io/FileAPI/#dfn-file</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-file">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-dfn-file①">2.3.1. The getFile() method</a> <a href="#ref-for-dfn-file②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serializable">
   <a href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable">https://html.spec.whatwg.org/multipage/structured-data.html#serializable</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serializable">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-serializable①">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-serializable②">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-window">
   <a href="https://html.spec.whatwg.org/multipage/window-object.html#window">https://html.spec.whatwg.org/multipage/window-object.html#window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-window">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-active-document">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">https://html.spec.whatwg.org/multipage/browsers.html#active-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-active-document">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-settings-object">3.1. The chooseFileSystemEntries() method</a>
    <li><a href="#ref-for-current-settings-object①">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-deserialization-steps">
   <a href="https://html.spec.whatwg.org/multipage/structured-data.html#deserialization-steps">https://html.spec.whatwg.org/multipage/structured-data.html#deserialization-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-deserialization-steps">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-deserialization-steps①">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-deserialization-steps②">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-messageerror">
   <a href="https://html.spec.whatwg.org/multipage/indices.html#event-messageerror">https://html.spec.whatwg.org/multipage/indices.html#event-messageerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-messageerror">5.3. First-party vs third-party contexts.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-origin-opaque">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque">https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-origin-opaque">3.1. The chooseFileSystemEntries() method</a>
    <li><a href="#ref-for-concept-origin-opaque①">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-settings-object-origin">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-settings-object-origin">2.2. The FileSystemHandle interface</a> <a href="#ref-for-concept-settings-object-origin①">(2)</a>
    <li><a href="#ref-for-concept-settings-object-origin②">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-concept-settings-object-origin③">(2)</a>
    <li><a href="#ref-for-concept-settings-object-origin④">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-relevant-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relevant-settings-object">2.2. The FileSystemHandle interface</a> <a href="#ref-for-relevant-settings-object①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-browsing-context">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-same-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">https://html.spec.whatwg.org/multipage/origin.html#same-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-origin">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-same-origin①">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serializable-objects">
   <a href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects">https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serializable-objects">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-serializable-objects①">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-serializable-objects②">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serialization-steps">
   <a href="https://html.spec.whatwg.org/multipage/structured-data.html#serialization-steps">https://html.spec.whatwg.org/multipage/structured-data.html#serialization-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serialization-steps">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-serialization-steps①">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-serialization-steps②">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-top-level-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-top-level-browsing-context">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-top-level-browsing-context①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ordered-set">
   <a href="https://infra.spec.whatwg.org/#ordered-set">https://infra.spec.whatwg.org/#ordered-set</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ordered-set">2.1. Concepts</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-enumdef-permissionstate">
   <a href="https://w3c.github.io/permissions/#enumdef-permissionstate">https://w3c.github.io/permissions/#enumdef-permissionstate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-permissionstate">2.2. The FileSystemHandle interface</a> <a href="#ref-for-enumdef-permissionstate①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-promise-rejected-with">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with">https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-promise-rejected-with">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-a-promise-rejected-with①">(2)</a>
    <li><a href="#ref-for-a-promise-rejected-with②">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-BufferSource">
   <a href="https://heycam.github.io/webidl/#BufferSource">https://heycam.github.io/webidl/#BufferSource</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-BufferSource">2.5. The FileSystemWriter interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-datacloneerror">
   <a href="https://heycam.github.io/webidl/#datacloneerror">https://heycam.github.io/webidl/#datacloneerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-datacloneerror">2.2. The FileSystemHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-Exposed①">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-Exposed②">2.4. The FileSystemDirectoryHandle interface</a>
    <li><a href="#ref-for-Exposed③">2.5. The FileSystemWriter interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SecureContext">
   <a href="https://heycam.github.io/webidl/#SecureContext">https://heycam.github.io/webidl/#SecureContext</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SecureContext">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-SecureContext①">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-SecureContext②">2.4. The FileSystemDirectoryHandle interface</a>
    <li><a href="#ref-for-SecureContext③">2.5. The FileSystemWriter interface</a>
    <li><a href="#ref-for-SecureContext④">3.1. The chooseFileSystemEntries() method</a>
    <li><a href="#ref-for-SecureContext⑤">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-securityerror">
   <a href="https://heycam.github.io/webidl/#securityerror">https://heycam.github.io/webidl/#securityerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-securityerror">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-securityerror①">(2)</a>
    <li><a href="#ref-for-securityerror②">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-USVString">
   <a href="https://heycam.github.io/webidl/#idl-USVString">https://heycam.github.io/webidl/#idl-USVString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-USVString">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-idl-USVString①">2.4. The FileSystemDirectoryHandle interface</a> <a href="#ref-for-idl-USVString②">(2)</a> <a href="#ref-for-idl-USVString③">(3)</a>
    <li><a href="#ref-for-idl-USVString④">2.5. The FileSystemWriter interface</a>
    <li><a href="#ref-for-idl-USVString⑤">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-idl-USVString⑥">(2)</a> <a href="#ref-for-idl-USVString⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">2.2. The FileSystemHandle interface</a> <a href="#ref-for-idl-boolean①">(2)</a> <a href="#ref-for-idl-boolean②">(3)</a>
    <li><a href="#ref-for-idl-boolean③">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-idl-boolean④">2.4. The FileSystemDirectoryHandle interface</a> <a href="#ref-for-idl-boolean⑤">(2)</a> <a href="#ref-for-idl-boolean⑥">(3)</a>
    <li><a href="#ref-for-idl-boolean⑦">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-idl-boolean⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-object">
   <a href="https://heycam.github.io/webidl/#idl-object">https://heycam.github.io/webidl/#idl-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-object">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-unsigned-long-long">
   <a href="https://heycam.github.io/webidl/#idl-unsigned-long-long">https://heycam.github.io/webidl/#idl-unsigned-long-long</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-unsigned-long-long">2.5. The FileSystemWriter interface</a> <a href="#ref-for-idl-unsigned-long-long①">(2)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[FILE-API]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dfn-Blob" style="color:initial">Blob</span>
     <li><span class="dfn-paneled" id="term-for-dfn-file" style="color:initial">File</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-serializable" style="color:initial">Serializable</span>
     <li><span class="dfn-paneled" id="term-for-window" style="color:initial">Window</span>
     <li><span class="dfn-paneled" id="term-for-active-document" style="color:initial">active document</span>
     <li><span class="dfn-paneled" id="term-for-current-settings-object" style="color:initial">current settings object</span>
     <li><span class="dfn-paneled" id="term-for-deserialization-steps" style="color:initial">deserialization steps</span>
     <li><span class="dfn-paneled" id="term-for-event-messageerror" style="color:initial">messageerror</span>
     <li><span class="dfn-paneled" id="term-for-concept-origin-opaque" style="color:initial">opaque origin</span>
     <li><span class="dfn-paneled" id="term-for-concept-settings-object-origin" style="color:initial">origin <small>(for environment settings object)</small></span>
     <li><span class="dfn-paneled" id="term-for-relevant-settings-object" style="color:initial">relevant settings object</span>
     <li><span class="dfn-paneled" id="term-for-responsible-browsing-context" style="color:initial">responsible browsing context</span>
     <li><span class="dfn-paneled" id="term-for-same-origin" style="color:initial">same origin</span>
     <li><span class="dfn-paneled" id="term-for-serializable-objects" style="color:initial">serializable objects</span>
     <li><span class="dfn-paneled" id="term-for-serialization-steps" style="color:initial">serialization steps</span>
     <li><span class="dfn-paneled" id="term-for-top-level-browsing-context" style="color:initial">top-level browsing context</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-ordered-set" style="color:initial">set</span>
    </ul>
   <li>
    <a data-link-type="biblio">[permissions]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-enumdef-permissionstate" style="color:initial">PermissionState</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-a-promise-rejected-with" style="color:initial">a promise rejected with</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-BufferSource" style="color:initial">BufferSource</span>
     <li><span class="dfn-paneled" id="term-for-datacloneerror" style="color:initial">DataCloneError</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-SecureContext" style="color:initial">SecureContext</span>
     <li><span class="dfn-paneled" id="term-for-securityerror" style="color:initial">SecurityError</span>
     <li><span class="dfn-paneled" id="term-for-idl-USVString" style="color:initial">USVString</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
     <li><span class="dfn-paneled" id="term-for-idl-object" style="color:initial">object</span>
     <li><span class="dfn-paneled" id="term-for-idl-unsigned-long-long" style="color:initial">unsigned long long</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-file-api">[FILE-API]
   <dd>Marijn Kruisselbrink; Arun Ranganathan. <a href="https://www.w3.org/TR/FileAPI/">File API</a>. 31 May 2019. WD. URL: <a href="https://www.w3.org/TR/FileAPI/">https://www.w3.org/TR/FileAPI/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-permissions">[PERMISSIONS]
   <dd>Mounir Lamouri; Marcos Caceres; Jeffrey Yasskin. <a href="https://www.w3.org/TR/permissions/">Permissions</a>. 25 September 2017. WD. URL: <a href="https://www.w3.org/TR/permissions/">https://www.w3.org/TR/permissions/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd>Domenic Denicola. <a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 9 November 2018. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-entries-api">[ENTRIES-API]
   <dd><a href="https://wicg.github.io/entries-api/">File and Directory Entries API</a>. Living Standard. URL: <a href="https://wicg.github.io/entries-api/">https://wicg.github.io/entries-api/</a>
   <dt id="biblio-file-system-api">[FILE-SYSTEM-API]
   <dd>Eric Uhrhane. <a href="https://www.w3.org/TR/file-system-api/">File API: Directories and System</a>. 24 April 2014. NOTE. URL: <a href="https://www.w3.org/TR/file-system-api/">https://www.w3.org/TR/file-system-api/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def"><c- b>dictionary</c-> <a href="#dictdef-filesystemhandlepermissiondescriptor"><code><c- g>FileSystemHandlePermissionDescriptor</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑨"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-filesystemhandlepermissiondescriptor-writable"><code><c- g>writable</c-></code></a> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑥"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable" id="ref-for-serializable③"><c- g>Serializable</c-></a>]
<c- b>interface</c-> <a href="#filesystemhandle"><code><c- g>FileSystemHandle</c-></code></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-filesystemhandle-isfile" id="ref-for-dom-filesystemhandle-isfile②"><c- g>isFile</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-filesystemhandle-isdirectory" id="ref-for-dom-filesystemhandle-isdirectory②"><c- g>isDirectory</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑧"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#dom-filesystemhandle-name" id="ref-for-dom-filesystemhandle-name②"><c- g>name</c-></a>;

  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#enumdef-permissionstate" id="ref-for-enumdef-permissionstate②"><c- n>PermissionState</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemhandle-querypermission" id="ref-for-dom-filesystemhandle-querypermission⑤"><c- g>queryPermission</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemhandlepermissiondescriptor" id="ref-for-dictdef-filesystemhandlepermissiondescriptor②"><c- n>FileSystemHandlePermissionDescriptor</c-></a> <a href="#dom-filesystemhandle-querypermission-descriptor-descriptor"><code><c- g>descriptor</c-></code></a> = {});
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://w3c.github.io/permissions/#enumdef-permissionstate" id="ref-for-enumdef-permissionstate①①"><c- n>PermissionState</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemhandle-requestpermission" id="ref-for-dom-filesystemhandle-requestpermission⑧"><c- g>requestPermission</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemhandlepermissiondescriptor" id="ref-for-dictdef-filesystemhandlepermissiondescriptor①①"><c- n>FileSystemHandlePermissionDescriptor</c-></a> <a href="#dom-filesystemhandle-requestpermission-descriptor-descriptor"><code><c- g>descriptor</c-></code></a> = {});
};

<c- b>dictionary</c-> <a href="#dictdef-filesystemcreatewriteroptions"><code><c- g>FileSystemCreateWriterOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-filesystemcreatewriteroptions-keepexistingdata"><code><c- g>keepExistingData</c-></code></a> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable" id="ref-for-serializable①①"><c- g>Serializable</c-></a>]
<c- b>interface</c-> <a href="#filesystemfilehandle"><code><c- g>FileSystemFileHandle</c-></code></a> : <a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle⑤①"><c- n>FileSystemHandle</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://w3c.github.io/FileAPI/#dfn-file" id="ref-for-dfn-file③"><c- n>File</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemfilehandle-getfile" id="ref-for-dom-filesystemfilehandle-getfile③"><c- g>getFile</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemwriter" id="ref-for-filesystemwriter③"><c- n>FileSystemWriter</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemfilehandle-createwriter" id="ref-for-dom-filesystemfilehandle-createwriter④"><c- g>createWriter</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemcreatewriteroptions" id="ref-for-dictdef-filesystemcreatewriteroptions①"><c- n>FileSystemCreateWriterOptions</c-></a> <a href="#dom-filesystemfilehandle-createwriter-options-options"><code><c- g>options</c-></code></a> = {});
};

<c- b>dictionary</c-> <a href="#dictdef-filesystemgetfileoptions"><code><c- g>FileSystemGetFileOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean④①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-filesystemgetfileoptions-create"><code><c- g>create</c-></code></a> = <c- b>false</c->;
};

<c- b>dictionary</c-> <a href="#dictdef-filesystemgetdirectoryoptions"><code><c- g>FileSystemGetDirectoryOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑤①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-filesystemgetdirectoryoptions-create"><code><c- g>create</c-></code></a> = <c- b>false</c->;
};

<c- b>dictionary</c-> <a href="#dictdef-filesystemremoveoptions"><code><c- g>FileSystemRemoveOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑥①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-filesystemremoveoptions-recursive"><code><c- g>recursive</c-></code></a> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://html.spec.whatwg.org/multipage/structured-data.html#serializable" id="ref-for-serializable②①"><c- g>Serializable</c-></a>]
<c- b>interface</c-> <a href="#filesystemdirectoryhandle"><code><c- g>FileSystemDirectoryHandle</c-></code></a> : <a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle⑦①"><c- n>FileSystemHandle</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemfilehandle" id="ref-for-filesystemfilehandle③①"><c- n>FileSystemFileHandle</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getfile" id="ref-for-dom-filesystemdirectoryhandle-getfile⑤"><c- g>getFile</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①①"><c- b>USVString</c-></a> <a href="#dom-filesystemdirectoryhandle-getfile-name-options-name"><code><c- g>name</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemgetfileoptions" id="ref-for-dictdef-filesystemgetfileoptions①"><c- n>FileSystemGetFileOptions</c-></a> <a href="#dom-filesystemdirectoryhandle-getfile-name-options-options"><code><c- g>options</c-></code></a> = {});
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle②①"><c- n>FileSystemDirectoryHandle</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getdirectory" id="ref-for-dom-filesystemdirectoryhandle-getdirectory⑤"><c- g>getDirectory</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString②①"><c- b>USVString</c-></a> <a href="#dom-filesystemdirectoryhandle-getdirectory-name-options-name"><code><c- g>name</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemgetdirectoryoptions" id="ref-for-dictdef-filesystemgetdirectoryoptions①"><c- n>FileSystemGetDirectoryOptions</c-></a> <a href="#dom-filesystemdirectoryhandle-getdirectory-name-options-options"><code><c- g>options</c-></code></a> = {});

  // This really returns an async iterable, but that is not yet expressable in WebIDL.
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object①"><c- b>object</c-></a> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getentries" id="ref-for-dom-filesystemdirectoryhandle-getentries③"><c- g>getEntries</c-></a>();

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-removeentry" id="ref-for-dom-filesystemdirectoryhandle-removeentry⑤"><c- g>removeEntry</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString③①"><c- b>USVString</c-></a> <a href="#dom-filesystemdirectoryhandle-removeentry-name-options-name"><code><c- g>name</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-filesystemremoveoptions" id="ref-for-dictdef-filesystemremoveoptions①"><c- n>FileSystemRemoveOptions</c-></a> <a href="#dom-filesystemdirectoryhandle-removeentry-name-options-options"><code><c- g>options</c-></code></a> = {});
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a href="#filesystemwriter"><code><c- g>FileSystemWriter</c-></code></a> {
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemwriter-write" id="ref-for-dom-filesystemwriter-write③"><c- g>write</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long②"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a href="#dom-filesystemwriter-write-position-data-position"><code><c- g>position</c-></code></a>, (<a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#BufferSource" id="ref-for-BufferSource①"><c- n>BufferSource</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://w3c.github.io/FileAPI/#dfn-Blob" id="ref-for-dfn-Blob①"><c- n>Blob</c-></a> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString④①"><c- b>USVString</c-></a>) <a href="#dom-filesystemwriter-write-position-data-data"><code><c- g>data</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemwriter-truncate" id="ref-for-dom-filesystemwriter-truncate③"><c- g>truncate</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long①①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a href="#dom-filesystemwriter-truncate-size-size"><code><c- g>size</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-filesystemwriter-close" id="ref-for-dom-filesystemwriter-close②①"><c- g>close</c-></a>();
};

<c- b>enum</c-> <a href="#enumdef-choosefilesystementriestype"><code><c- g>ChooseFileSystemEntriesType</c-></code></a> { <a href="#dom-choosefilesystementriestype-open-file"><code><c- s>"open-file"</c-></code></a>, <a href="#dom-choosefilesystementriestype-save-file"><code><c- s>"save-file"</c-></code></a>, <a href="#dom-choosefilesystementriestype-open-directory"><code><c- s>"open-directory"</c-></code></a> };

<c- b>dictionary</c-> <a href="#dictdef-choosefilesystementriesoptionsaccepts"><code><c- g>ChooseFileSystemEntriesOptionsAccepts</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑤①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-choosefilesystementriesoptionsaccepts-description"><code><c- g>description</c-></code></a>;
  <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑥①"><c- b>USVString</c-></a>> <a data-type="sequence<USVString> " href="#dom-choosefilesystementriesoptionsaccepts-mimetypes"><code><c- g>mimeTypes</c-></code></a>;
  <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑦①"><c- b>USVString</c-></a>> <a data-type="sequence<USVString> " href="#dom-choosefilesystementriesoptionsaccepts-extensions"><code><c- g>extensions</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-choosefilesystementriesoptions"><code><c- g>ChooseFileSystemEntriesOptions</c-></code></a> {
    <a class="n" data-link-type="idl-name" href="#enumdef-choosefilesystementriestype" id="ref-for-enumdef-choosefilesystementriestype①"><c- n>ChooseFileSystemEntriesType</c-></a> <a data-default="&quot;open-file&quot;" data-type="ChooseFileSystemEntriesType " href="#dom-choosefilesystementriesoptions-type"><code><c- g>type</c-></code></a> = "open-file";
    <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑦①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-choosefilesystementriesoptions-multiple"><code><c- g>multiple</c-></code></a> = <c- b>false</c->;
    <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-choosefilesystementriesoptionsaccepts" id="ref-for-dictdef-choosefilesystementriesoptionsaccepts①"><c- n>ChooseFileSystemEntriesOptionsAccepts</c-></a>> <a data-type="sequence<ChooseFileSystemEntriesOptionsAccepts> " href="#dom-choosefilesystementriesoptions-accepts"><code><c- g>accepts</c-></code></a>;
    <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑧①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-choosefilesystementriesoptions-excludeacceptalloption"><code><c- g>excludeAcceptAllOption</c-></code></a> = <c- b>false</c->;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④①"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window①"><c- g>Window</c-></a> {
    <c- b>Promise</c->&lt;(<a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle⑨①"><c- n>FileSystemHandle</c-></a> <c- b>or</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemhandle" id="ref-for-filesystemhandle①⓪①"><c- n>FileSystemHandle</c-></a>>)>
        <a class="idl-code" data-link-type="method" href="#dom-window-choosefilesystementries" id="ref-for-dom-window-choosefilesystementries②①"><c- g>chooseFileSystemEntries</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-choosefilesystementriesoptions" id="ref-for-dictdef-choosefilesystementriesoptions①"><c- n>ChooseFileSystemEntriesOptions</c-></a> <a href="#dom-window-choosefilesystementries-options-options"><code><c- g>options</c-></code></a> = {});
};

<c- b>enum</c-> <a href="#enumdef-systemdirectorytype"><code><c- g>SystemDirectoryType</c-></code></a> {
  <a href="#dom-systemdirectorytype-sandbox"><code><c- s>"sandbox"</c-></code></a>
};

<c- b>dictionary</c-> <a href="#dictdef-getsystemdirectoryoptions"><code><c- g>GetSystemDirectoryOptions</c-></code></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-systemdirectorytype" id="ref-for-enumdef-systemdirectorytype①"><c- n>SystemDirectoryType</c-></a> <a data-type="SystemDirectoryType " href="#dom-getsystemdirectoryoptions-type"><code><c- g>type</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤①"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle④①"><c- g>FileSystemDirectoryHandle</c-></a> {
  <c- b>static</c-> <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#filesystemdirectoryhandle" id="ref-for-filesystemdirectoryhandle⑤①"><c- n>FileSystemDirectoryHandle</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-filesystemdirectoryhandle-getsystemdirectory" id="ref-for-dom-filesystemdirectoryhandle-getsystemdirectory①①"><c- g>getSystemDirectory</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-getsystemdirectoryoptions" id="ref-for-dictdef-getsystemdirectoryoptions①"><c- n>GetSystemDirectoryOptions</c-></a> <a href="#dom-filesystemdirectoryhandle-getsystemdirectory-options-options"><code><c- g>options</c-></code></a>);
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> TODO: Explain how entries map to files on disk (multiple entries can map to the same file or
directory on disk but doesn’t have to map to any file on disk).<a href="#issue-7a61bf3c"> ↵ </a></div>
   <div class="issue"> the currently described API here assumes a model where it is not possible to have a
    write-only handle. I.e. it is not possible to have or request write access without also having
    read access. There definitely are use cases for write-only handles (i.e. directory downloads),
    so we might have to reconsider this.<a href="#issue-af0c279b"> ↵ </a></div>
   <div class="issue"> There has been some discussion around and desire for a "inPlace" mode for createWriter (where
changes will be written to the actual underlying file as they are written to the writer, for example
to support in-place modification of large files or things like databases). This is not currently
implemented in Chrome. Implementing this is currently blocked on figuring out how to combine the
desire to run malware checks with the desire to let websites make fast in-place modifications to
existing large files.<a href="#issue-6e95a203"> ↵ </a></div>
   <div class="issue"> Should we have separate getFile and getDirectory methods, or just a single getChild/getEntry
method?<a href="#issue-a4e7d3b2"> ↵ </a></div>
   <div class="issue"> Having getFile methods in both FileSystemDirectoryHandle and FileSystemFileHandle, but with
very different behavior might be confusing? Perhaps rename at least one of them (but see also
previous issue).<a href="#issue-6152e539"> ↵ </a></div>
   <div class="issue"> Should getEntries be its own method, or should FileSystemDirectoryHandle just be an async
iterable itself?<a href="#issue-bd7b13a2"> ↵ </a></div>
   <div class="issue"> We will probably want some method to make it possible to compare two handles, and/or determine
if one handle represents a descendant of another handle. Such a method will enable for example an IDE
to detect that the user tries to open a file (through the file picker), where that file actually is
part of the "project" the IDE has open, allowing the IDE to highlight the selected file in a directory
tree.<a href="#issue-1da05031"> ↵ </a></div>
   <div class="issue"> We want some kind of integration with writable streams. One possible option is to make
FileStreamWriter inherit from WritableStream, but other options should be considered as well. <a href="https://github.com/wicg/native-file-system/issues/19">&lt;https://github.com/wicg/native-file-system/issues/19></a><a href="#issue-b9e65915"> ↵ </a></div>
   <div class="issue"> There must be a better way to express this "no third-party iframes" constraint.<a href="#issue-0fb1070c"> ↵ </a></div>
   <div class="issue"> getSystemDirectory might not be the best name. Also perhaps should be on Window rather
than on FileSystemDirectoryHandle. <a href="https://github.com/wicg/native-file-system/issues/27">&lt;https://github.com/wicg/native-file-system/issues/27></a><a href="#issue-2a3d989a"> ↵ </a></div>
   <div class="issue"> "Atomic writes" attempts to make it explicit what this API can and can’t do, and how
performance can be effected by safe browsing checks. <a href="https://github.com/wicg/native-file-system/issues/51">&lt;https://github.com/wicg/native-file-system/issues/51></a><a href="#issue-1f744509"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="entry">
   <b><a href="#entry">#entry</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-entry">2.1. Concepts</a>
    <li><a href="#ref-for-entry①">2.2. The FileSystemHandle interface</a> <a href="#ref-for-entry②">(2)</a> <a href="#ref-for-entry③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="entry-name">
   <b><a href="#entry-name">#entry-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-entry-name">2.2. The FileSystemHandle interface</a> <a href="#ref-for-entry-name①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="file">
   <b><a href="#file">#file</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-file">2.1. Concepts</a> <a href="#ref-for-file①">(2)</a>
    <li><a href="#ref-for-file②">2.2. The FileSystemHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="directory">
   <b><a href="#directory">#directory</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-directory">2.1. Concepts</a> <a href="#ref-for-directory①">(2)</a>
    <li><a href="#ref-for-directory②">2.2. The FileSystemHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-filesystemhandlepermissiondescriptor">
   <b><a href="#dictdef-filesystemhandlepermissiondescriptor">#dictdef-filesystemhandlepermissiondescriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-filesystemhandlepermissiondescriptor">2.2. The FileSystemHandle interface</a> <a href="#ref-for-dictdef-filesystemhandlepermissiondescriptor①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemhandlepermissiondescriptor-writable">
   <b><a href="#dom-filesystemhandlepermissiondescriptor-writable">#dom-filesystemhandlepermissiondescriptor-writable</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemhandlepermissiondescriptor-writable">2.2.1. The queryPermission() method</a> <a href="#ref-for-dom-filesystemhandlepermissiondescriptor-writable①">(2)</a>
    <li><a href="#ref-for-dom-filesystemhandlepermissiondescriptor-writable②">2.2.2. The requestPermission() method</a> <a href="#ref-for-dom-filesystemhandlepermissiondescriptor-writable③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="filesystemhandle">
   <b><a href="#filesystemhandle">#filesystemhandle</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-filesystemhandle">2.2. The FileSystemHandle interface</a> <a href="#ref-for-filesystemhandle①">(2)</a> <a href="#ref-for-filesystemhandle②">(3)</a> <a href="#ref-for-filesystemhandle③">(4)</a> <a href="#ref-for-filesystemhandle④">(5)</a>
    <li><a href="#ref-for-filesystemhandle⑤">2.3. The FileSystemFileHandle interface</a> <a href="#ref-for-filesystemhandle⑥">(2)</a>
    <li><a href="#ref-for-filesystemhandle⑦">2.4. The FileSystemDirectoryHandle interface</a> <a href="#ref-for-filesystemhandle⑧">(2)</a>
    <li><a href="#ref-for-filesystemhandle⑨">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-filesystemhandle①⓪">(2)</a> <a href="#ref-for-filesystemhandle①①">(3)</a> <a href="#ref-for-filesystemhandle①②">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="filesystemhandle-entry">
   <b><a href="#filesystemhandle-entry">#filesystemhandle-entry</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-filesystemhandle-entry">2.2. The FileSystemHandle interface</a> <a href="#ref-for-filesystemhandle-entry①">(2)</a> <a href="#ref-for-filesystemhandle-entry②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemhandle-isfile">
   <b><a href="#dom-filesystemhandle-isfile">#dom-filesystemhandle-isfile</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemhandle-isfile">2.2. The FileSystemHandle interface</a> <a href="#ref-for-dom-filesystemhandle-isfile①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemhandle-isdirectory">
   <b><a href="#dom-filesystemhandle-isdirectory">#dom-filesystemhandle-isdirectory</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemhandle-isdirectory">2.2. The FileSystemHandle interface</a> <a href="#ref-for-dom-filesystemhandle-isdirectory①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemhandle-name">
   <b><a href="#dom-filesystemhandle-name">#dom-filesystemhandle-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemhandle-name">2.2. The FileSystemHandle interface</a> <a href="#ref-for-dom-filesystemhandle-name①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemhandle-querypermission">
   <b><a href="#dom-filesystemhandle-querypermission">#dom-filesystemhandle-querypermission</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemhandle-querypermission">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-dom-filesystemhandle-querypermission①">2.2.1. The queryPermission() method</a> <a href="#ref-for-dom-filesystemhandle-querypermission②">(2)</a> <a href="#ref-for-dom-filesystemhandle-querypermission③">(3)</a> <a href="#ref-for-dom-filesystemhandle-querypermission④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemhandle-requestpermission">
   <b><a href="#dom-filesystemhandle-requestpermission">#dom-filesystemhandle-requestpermission</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemhandle-requestpermission">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-dom-filesystemhandle-requestpermission①">2.2.1. The queryPermission() method</a> <a href="#ref-for-dom-filesystemhandle-requestpermission②">(2)</a>
    <li><a href="#ref-for-dom-filesystemhandle-requestpermission③">2.2.2. The requestPermission() method</a> <a href="#ref-for-dom-filesystemhandle-requestpermission④">(2)</a> <a href="#ref-for-dom-filesystemhandle-requestpermission⑤">(3)</a> <a href="#ref-for-dom-filesystemhandle-requestpermission⑥">(4)</a>
    <li><a href="#ref-for-dom-filesystemhandle-requestpermission⑦">5.3. First-party vs third-party contexts.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-filesystemcreatewriteroptions">
   <b><a href="#dictdef-filesystemcreatewriteroptions">#dictdef-filesystemcreatewriteroptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-filesystemcreatewriteroptions">2.3. The FileSystemFileHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemcreatewriteroptions-keepexistingdata">
   <b><a href="#dom-filesystemcreatewriteroptions-keepexistingdata">#dom-filesystemcreatewriteroptions-keepexistingdata</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemcreatewriteroptions-keepexistingdata">2.3.2. The createWriter() method</a> <a href="#ref-for-dom-filesystemcreatewriteroptions-keepexistingdata①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="filesystemfilehandle">
   <b><a href="#filesystemfilehandle">#filesystemfilehandle</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-filesystemfilehandle">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-filesystemfilehandle①">2.3. The FileSystemFileHandle interface</a> <a href="#ref-for-filesystemfilehandle②">(2)</a>
    <li><a href="#ref-for-filesystemfilehandle③">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemfilehandle-getfile">
   <b><a href="#dom-filesystemfilehandle-getfile">#dom-filesystemfilehandle-getfile</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemfilehandle-getfile">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-dom-filesystemfilehandle-getfile①">2.3.1. The getFile() method</a> <a href="#ref-for-dom-filesystemfilehandle-getfile②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemfilehandle-createwriter">
   <b><a href="#dom-filesystemfilehandle-createwriter">#dom-filesystemfilehandle-createwriter</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemfilehandle-createwriter">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-dom-filesystemfilehandle-createwriter①">2.3.2. The createWriter() method</a> <a href="#ref-for-dom-filesystemfilehandle-createwriter②">(2)</a> <a href="#ref-for-dom-filesystemfilehandle-createwriter③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-filesystemgetfileoptions">
   <b><a href="#dictdef-filesystemgetfileoptions">#dictdef-filesystemgetfileoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-filesystemgetfileoptions">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemgetfileoptions-create">
   <b><a href="#dom-filesystemgetfileoptions-create">#dom-filesystemgetfileoptions-create</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemgetfileoptions-create">2.4.1. The getFile() method</a> <a href="#ref-for-dom-filesystemgetfileoptions-create①">(2)</a> <a href="#ref-for-dom-filesystemgetfileoptions-create②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-filesystemgetdirectoryoptions">
   <b><a href="#dictdef-filesystemgetdirectoryoptions">#dictdef-filesystemgetdirectoryoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-filesystemgetdirectoryoptions">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemgetdirectoryoptions-create">
   <b><a href="#dom-filesystemgetdirectoryoptions-create">#dom-filesystemgetdirectoryoptions-create</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemgetdirectoryoptions-create">2.4.2. The getDirectory() method</a> <a href="#ref-for-dom-filesystemgetdirectoryoptions-create①">(2)</a> <a href="#ref-for-dom-filesystemgetdirectoryoptions-create②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-filesystemremoveoptions">
   <b><a href="#dictdef-filesystemremoveoptions">#dictdef-filesystemremoveoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-filesystemremoveoptions">2.4. The FileSystemDirectoryHandle interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemremoveoptions-recursive">
   <b><a href="#dom-filesystemremoveoptions-recursive">#dom-filesystemremoveoptions-recursive</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemremoveoptions-recursive">2.4.4. The removeEntry() method</a> <a href="#ref-for-dom-filesystemremoveoptions-recursive①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="filesystemdirectoryhandle">
   <b><a href="#filesystemdirectoryhandle">#filesystemdirectoryhandle</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-filesystemdirectoryhandle">2.2. The FileSystemHandle interface</a>
    <li><a href="#ref-for-filesystemdirectoryhandle①">2.4. The FileSystemDirectoryHandle interface</a> <a href="#ref-for-filesystemdirectoryhandle②">(2)</a> <a href="#ref-for-filesystemdirectoryhandle③">(3)</a>
    <li><a href="#ref-for-filesystemdirectoryhandle④">4.1. The getSystemDirectory() method</a> <a href="#ref-for-filesystemdirectoryhandle⑤">(2)</a> <a href="#ref-for-filesystemdirectoryhandle⑥">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemdirectoryhandle-getfile">
   <b><a href="#dom-filesystemdirectoryhandle-getfile">#dom-filesystemdirectoryhandle-getfile</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getfile">2.4. The FileSystemDirectoryHandle interface</a>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getfile①">2.4.1. The getFile() method</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getfile②">(2)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getfile③">(3)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getfile④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemdirectoryhandle-getdirectory">
   <b><a href="#dom-filesystemdirectoryhandle-getdirectory">#dom-filesystemdirectoryhandle-getdirectory</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getdirectory">2.4. The FileSystemDirectoryHandle interface</a>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getdirectory①">2.4.2. The getDirectory() method</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getdirectory②">(2)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getdirectory③">(3)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getdirectory④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemdirectoryhandle-getentries">
   <b><a href="#dom-filesystemdirectoryhandle-getentries">#dom-filesystemdirectoryhandle-getentries</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getentries">2.4. The FileSystemDirectoryHandle interface</a>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getentries①">2.4.3. The getEntries() method</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getentries②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemdirectoryhandle-removeentry">
   <b><a href="#dom-filesystemdirectoryhandle-removeentry">#dom-filesystemdirectoryhandle-removeentry</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-removeentry">2.4. The FileSystemDirectoryHandle interface</a>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-removeentry①">2.4.4. The removeEntry() method</a> <a href="#ref-for-dom-filesystemdirectoryhandle-removeentry②">(2)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-removeentry③">(3)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-removeentry④">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="filesystemwriter">
   <b><a href="#filesystemwriter">#filesystemwriter</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-filesystemwriter">2.3. The FileSystemFileHandle interface</a>
    <li><a href="#ref-for-filesystemwriter①">2.3.2. The createWriter() method</a>
    <li><a href="#ref-for-filesystemwriter②">2.5. The FileSystemWriter interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemwriter-write">
   <b><a href="#dom-filesystemwriter-write">#dom-filesystemwriter-write</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemwriter-write">2.5. The FileSystemWriter interface</a>
    <li><a href="#ref-for-dom-filesystemwriter-write①">2.5.1. The write() method</a> <a href="#ref-for-dom-filesystemwriter-write②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemwriter-truncate">
   <b><a href="#dom-filesystemwriter-truncate">#dom-filesystemwriter-truncate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemwriter-truncate">2.5. The FileSystemWriter interface</a>
    <li><a href="#ref-for-dom-filesystemwriter-truncate①">2.5.2. The truncate() method</a> <a href="#ref-for-dom-filesystemwriter-truncate②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemwriter-close">
   <b><a href="#dom-filesystemwriter-close">#dom-filesystemwriter-close</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemwriter-close">2.3.2. The createWriter() method</a> <a href="#ref-for-dom-filesystemwriter-close①">(2)</a>
    <li><a href="#ref-for-dom-filesystemwriter-close②">2.5. The FileSystemWriter interface</a>
    <li><a href="#ref-for-dom-filesystemwriter-close③">2.5.1. The write() method</a>
    <li><a href="#ref-for-dom-filesystemwriter-close④">2.5.2. The truncate() method</a>
    <li><a href="#ref-for-dom-filesystemwriter-close⑤">2.5.3. The close() method</a> <a href="#ref-for-dom-filesystemwriter-close⑥">(2)</a> <a href="#ref-for-dom-filesystemwriter-close⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-choosefilesystementriestype">
   <b><a href="#enumdef-choosefilesystementriestype">#enumdef-choosefilesystementriestype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-choosefilesystementriestype">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriestype-open-file">
   <b><a href="#dom-choosefilesystementriestype-open-file">#dom-choosefilesystementriestype-open-file</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriestype-open-file">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriestype-save-file">
   <b><a href="#dom-choosefilesystementriestype-save-file">#dom-choosefilesystementriestype-save-file</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriestype-save-file">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriestype-open-directory">
   <b><a href="#dom-choosefilesystementriestype-open-directory">#dom-choosefilesystementriestype-open-directory</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriestype-open-directory">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-choosefilesystementriesoptionsaccepts">
   <b><a href="#dictdef-choosefilesystementriesoptionsaccepts">#dictdef-choosefilesystementriesoptionsaccepts</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-choosefilesystementriesoptionsaccepts">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptionsaccepts-description">
   <b><a href="#dom-choosefilesystementriesoptionsaccepts-description">#dom-choosefilesystementriesoptionsaccepts-description</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptionsaccepts-description">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-choosefilesystementriesoptionsaccepts-description①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptionsaccepts-mimetypes">
   <b><a href="#dom-choosefilesystementriesoptionsaccepts-mimetypes">#dom-choosefilesystementriesoptionsaccepts-mimetypes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptionsaccepts-mimetypes">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-choosefilesystementriesoptionsaccepts-mimetypes①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptionsaccepts-extensions">
   <b><a href="#dom-choosefilesystementriesoptionsaccepts-extensions">#dom-choosefilesystementriesoptionsaccepts-extensions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptionsaccepts-extensions">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-choosefilesystementriesoptionsaccepts-extensions①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-choosefilesystementriesoptions">
   <b><a href="#dictdef-choosefilesystementriesoptions">#dictdef-choosefilesystementriesoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-choosefilesystementriesoptions">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptions-type">
   <b><a href="#dom-choosefilesystementriesoptions-type">#dom-choosefilesystementriesoptions-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptions-type">3.1. The chooseFileSystemEntries() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptions-multiple">
   <b><a href="#dom-choosefilesystementriesoptions-multiple">#dom-choosefilesystementriesoptions-multiple</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptions-multiple">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-choosefilesystementriesoptions-multiple①">(2)</a> <a href="#ref-for-dom-choosefilesystementriesoptions-multiple②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptions-accepts">
   <b><a href="#dom-choosefilesystementriesoptions-accepts">#dom-choosefilesystementriesoptions-accepts</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptions-accepts">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-choosefilesystementriesoptions-accepts①">(2)</a> <a href="#ref-for-dom-choosefilesystementriesoptions-accepts②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-choosefilesystementriesoptions-excludeacceptalloption">
   <b><a href="#dom-choosefilesystementriesoptions-excludeacceptalloption">#dom-choosefilesystementriesoptions-excludeacceptalloption</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-choosefilesystementriesoptions-excludeacceptalloption">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-choosefilesystementriesoptions-excludeacceptalloption①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-window-choosefilesystementries">
   <b><a href="#dom-window-choosefilesystementries">#dom-window-choosefilesystementries</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-window-choosefilesystementries">2.2.1. The queryPermission() method</a>
    <li><a href="#ref-for-dom-window-choosefilesystementries①">3.1. The chooseFileSystemEntries() method</a> <a href="#ref-for-dom-window-choosefilesystementries②">(2)</a> <a href="#ref-for-dom-window-choosefilesystementries③">(3)</a>
    <li><a href="#ref-for-dom-window-choosefilesystementries④">5.3. First-party vs third-party contexts.</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-systemdirectorytype">
   <b><a href="#enumdef-systemdirectorytype">#enumdef-systemdirectorytype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-systemdirectorytype">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-systemdirectorytype-sandbox">
   <b><a href="#dom-systemdirectorytype-sandbox">#dom-systemdirectorytype-sandbox</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-systemdirectorytype-sandbox">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-getsystemdirectoryoptions">
   <b><a href="#dictdef-getsystemdirectoryoptions">#dictdef-getsystemdirectoryoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-getsystemdirectoryoptions">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-getsystemdirectoryoptions-type">
   <b><a href="#dom-getsystemdirectoryoptions-type">#dom-getsystemdirectoryoptions-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-getsystemdirectoryoptions-type">4.1. The getSystemDirectory() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-filesystemdirectoryhandle-getsystemdirectory">
   <b><a href="#dom-filesystemdirectoryhandle-getsystemdirectory">#dom-filesystemdirectoryhandle-getsystemdirectory</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-filesystemdirectoryhandle-getsystemdirectory">4.1. The getSystemDirectory() method</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getsystemdirectory①">(2)</a> <a href="#ref-for-dom-filesystemdirectoryhandle-getsystemdirectory②">(3)</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>